同一根BAR多空轉(zhuǎn)換時出問題
作者:開拓者 TB 來源:cxh99.com 發(fā)布時間:2017年06月04日
- 咨詢內(nèi)容:
0.png
(12.01 KB, 下載次數(shù): 0)
2017-2-2 17:18:53 上傳
- TB技術(shù)人員:
If(MarketPosition<>1 and High >= DispTop[1])
{
Buy(0,Max(Open,DispTop[1]));
}
if(MarketPosition<>-1 and l <= dispbottom[1])
{
SellShort(0,min(o,dispbottom[1]));
}
If(MarketPosition == 1 and BarsSinceEntry > 0)
{
If(Low <= DispBottom[1])
{
Sell(0,Min(Open,DispBottom[1]));
}
}
if(marketposition == -1 and barssinceentry>0)
{
if(h >= disptop[1])
{
BuyToCover(0,max(o,disptop[1]));
}
}
End
- TB客服:
好像是因為合并后BarsSinceEntry不等于0了,那怎么去解決這個問題?
- 網(wǎng)友回復(fù):
If(MarketPosition<>1 and High >= DispTop[1])
{
Buy(0,Max(Open,DispTop[1]));
barssinceentryl=CurrentBar;
}
if(MarketPosition<>-1 and l <= dispbottom[1])
{
SellShort(0,min(o,dispbottom[1]));
BarsSinceEntrys=CurrentBar;
}
If(MarketPosition == 1 and BarsSinceEntryl<>CurrentBar)
{
If(Low <= DispBottom[1])
{
Sell(0,Min(Open,DispBottom[1]));
}
}
if(marketposition == -1 and BarsSinceEntrys<>CurrentBar)
{
if(h >= disptop[1])
{
BuyToCover(0,max(o,disptop[1]));
}
}
好像也不是,改一下依舊不行