遇到自帶海龜公式中的一個(gè)問(wèn)題
作者:開(kāi)拓者 TB 來(lái)源:cxh99.com 發(fā)布時(shí)間:2013年06月18日
- 咨詢(xún)內(nèi)容:
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
這個(gè)是海龜法則例子中的一部分,其中平多的位置應(yīng)該是ExitLowestPrice - MinPoint 或跳空的open,可是為啥都是平倉(cāng)點(diǎn)在收盤(pán)價(jià)
ps:開(kāi)倉(cāng)以及空單開(kāi)倉(cāng)平倉(cāng)沒(méi)有問(wèn)題
- TB技術(shù)人員:
你這個(gè)是自帶海龜系統(tǒng)里面的代碼嗎?我的怎么和你的不一樣。
你去公式管理器打開(kāi)TurtleTrader,再看一看