全部 智大领峰 TBQuant功能 TBL语言 TB开户 问答专区 高手圈 其他
已解决
为何会有加仓?
loafertb 分享到
2024-08-11 19:21

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)

{




// 长周期突破开仓 Failsafe Breakout point

If(MarketPosition !=1 && (Time>notbef/10000 and Time<notaft/10000) || (Time>notbef1/10000 and Time<notaft1/10000))

{

If( Open >Close[1])

{

Buy(TurtleUnits,Open);

SendOrderThisBar = True;

}

}





 

  if(marketposition!=0 and Time>=0.1456 && Time<=0.15)

    {


     

               BuyToCover(0,Open);  

       

               Sell(0,Open);

    }



   if(marketposition!=0 and Time>=0.2256 && Time<=0.23)

    {


     

               BuyToCover(0,Open);  

       

               Sell(0,Open);

    }

   

}

日内交易,1分钟线,无仓位开仓一手,marketposition!=1,代表无多仓,为何会有加仓

kyover

https://www.tbquant.net/forumDetail?id=13403

你这个问题前面不是回过你了吗,if条件里面少了括号

2024-08-12 09:05
您未登录,请先 登录注册 后发表评论
顶部