Params
Numeric notbef(930); //Time
Numeric notaft(1456); //Time
Numeric notbef1(2130); //Time
Numeric notaft1(2256); //Time
Vars
Numeric TurtleUnits(1); // 交易手数
Bool SendOrderThisBar(False); // 当前Bar有过交易
Events
OnBar(ArrayRef<Integer> indexs)
{
If(MarketPosition ==0 && (Time>notbef/10000 and Time<notaft/10000) || (Time>notbef1/10000 and Time<notaft1/10000))
{
If( close >High[1])
{
Buy(TurtleUnits,Close);
SendOrderThisBar = True;
}
If( close<Low[1])
{
SellShort(TurtleUnits,Close);
SendOrderThisBar = True;
}
}
if(marketposition!=0 and Time>=0.1456 && Time<=0.15)
{
BuyToCover(0,Close);
Sell(0,Close);
}
if(marketposition!=0 and Time>=0.2256 && Time<=0.23)
{
BuyToCover(0,Close);
Sell(0,Close);
}
}
日内交易,无仓位MarketPosition ==0 开仓一手,未何有仓位仍然开创,改成MarketPosition <>1 || MarketPosition <>-1,仍然不行, 怎么修改
您的策略里用了Close来做判断,这个是会导致信号闪烁的,先把信号闪烁问题解决掉吧。