我模型中有止损代码,问题是我选择的程序化运行模式是K线走完,而我希望能在达到止损条件时立即止损。麻烦老师帮助实现。谢谢!
if enterprice-c>=1 then
多损:sell(holding>0,holding,market);
if c-enterprice>=1 then
空损:sellshort(holding<0,holding,market);
选择固定时间间隔模式,开仓平仓用上一根k的条件ref(buycond,1),ref(sellcond,1),止损代码不变,这样相当于开平仓是走完k,止损是及时止损