首页 > > 详细

代做指标公式、TB指标公式调试、帮做TB交易策略、开拓者道氏理论交易策略源码-开拓者公式

道氏理论内容:
//------------------------------------------------------------------------
// 简称: D1
// 名称: 道氏理论
// 类别: 交易指令
// 类型: 多头建仓
// 输出:
//------------------------------------------------------------------------

Params
Numeric ATime(918);
Numeric CTime(1510);
Numeric Lot(1);
Numeric MoneyLoss(0.6);
Numeric BarCross(1);
Numeric Length(5);

Vars
Numeric bTime(0);
Numeric MyClose(0);
Numeric MyDiff(0);
NumericSeries estP(0);
NumericSeries ExitP(0);
NumericSeries Position(0);
NumericSeries est(0);
NumericSeries est1(0);
NumericSeries est2(0);
NumericSeries est3(0);

Bool bTimeCon;
Bool BarUpCon;
Bool BarDownCon;
Bool BarExitCon;
Bool LongOpenCon;
Bool ShortOpenCon;
Bool LongExitCon;
Bool ShortExitCon;

Begin

If (Date != Date[1])
{
est = Open;
est1 = Open;
est2 = Open;
est3 = Open;
estP = 0;
ExitP = 0;
Position = 0;
MyClose = Open;
}
Else
{
est = est[1];
est1 = est1[1];
est2 = est2[1];
est3 = est3[1];
estP = estP[1];
ExitP = ExitP[1];
Position = Position[1];
If(Length != 0) MyClose = Average(Close[1],Length);
Else MyClose = Close[1];
}

MyDiff = MyClose * BarCross / 1000;

bTime = IntPart(Time*10000);
bTimeCon = (bTime > ATime) And (bTime est And MyClose > est1)) est = MyClose;
If(((MyClose - est) > MyDiff And est MyDiff And est > est1))
{
est3 = est2;
est2 = est1;
est1 = est;
est = MyClose;
}

If(Position > 0 And High > estP) estP = High;
If(Position 0) ExitP = estP * (100 - MoneyLoss) / 100;
If(Position = CTime)
{
If (Position > 0)
Sell(lot,Open);
Else
BuyToCover(lot,Open);
}

If(bTimeCon)
{
If (Position == 0)
{
If(est3 est1 And (est2 - est2 / 2000) >= est And est3 > est2)
{
SellShort(lot,Open);
Position = lot * -1;
estP = Open;
ExitP = estP * (100 + MoneyLoss) / 100;
Commentary(quot;ShortOpenquot;);
}
}

Else

{
If(Position > 0 And est3 > est1)
{
Sell(lot,Open);
Position = 0;
Commentary(quot;LongExit1quot;);
}

Else If(Position 0 And Open ExitP)
{
BuyToCover(lot,Open);
Position = 0;
Commentary(quot;ShortExit2quot;);
}
}
}

Commentary(quot;Position = quot;+Text(Position));
Commentary(quot;ExitP = quot;+Text(ExitP));
End

//------------------------------------------------------------------------
// 编译版本GS2004.06.12
// 用户版本2011/05/03 13:21
// 版权所有
// 更改声明TradeBlazer Software保留对TradeBlazer平台
//每一版本的TrabeBlazer公式修改和重写的权利
//------------------------------------------------------------------------
 

联系我们 - QQ: 88652583
© 2014 www.93stock.com
代写选股公式网!
声明:警惕假冒分子冒充本站提供证券咨询服务,选股公式网为非证券咨询机构,本站不提供有关股评、投资分析报告、股市预测,证券咨询等服务。本站仅提供股票、期货、黄金、外汇的软件技术交流与分享。本站文章为互联网文章,其仅供参考,并不构成投资建议。