遇到自带海龟公式中的一个问题
作者:开拓者 TB 来源:cxh99.com 发布时间:2013年06月18日
- 咨询内容:
Params
Numeric bolength(20);
Numeric Telength(10);
Vars
Numeric MinPoint;
NumericSeries DonchianHi;
NumericSeries DonchianLo;
Numeric myEntryPrice;
Numeric myExitPrice;
NumericSeries ExitHighestPrice;
NumericSeries ExitLowestPrice;
Begin
MinPoint = MinMove*PriceScale;
donchianhi =HighestFC(High[1],bolength);
DonchianLo = LowestFC(low[1],bolength);
ExitHighestPrice = HighestFC(High[1],Telength);
ExitLowestPrice = LowestFC(low[1],Telength);
If(marketposition == 0)
{
Commentary("donchianhi="+Text(donchianHi));
If(High > donchianHi)
{
myEntryPrice = donchianhi + MinPoint ;
myEntryPrice = IIF(myEntryPrice < Open,Open,myEntryPrice);
Buy(1,myEntryPrice);
}
}
If(marketposition == 1)
{
Commentary("ExitLowestPrice="+Text(ExitLowestPrice));
If(Low<ExitLowestPrice)
{
myEntryPrice = ExitLowestPrice - MinPoint;
myEntryPrice = IIF(myEntryPrice > Open,Open,myEntryPrice);
Sell(1,myExitPrice);
}
}
End
这个是海龟法则例子中的一部分,其中平多的位置应该是ExitLowestPrice - MinPoint 或跳空的open,可是为啥都是平仓点在收盘价
ps:开仓以及空单开仓平仓没有问题
- TB技术人员:
你这个是自带海龟系统里面的代码吗?我的怎么和你的不一样。
你去公式管理器打开TurtleTrader,再看一看