有条件。
OL = (ind==1 and new_efi==1) #open long cond
XL = (new_efi==-1 or ind==-1) #close long cond
OS= (ind==-1 and new_efi==-1) #open short cond
XS= (new_efi==1 or ind==1) #close short cond
它们在图表上绘制得很好,但 strategy.exit 函数不能在 XL 和 XS 条件下运行。
strategy.exit("XL","EL", when = XL, loss=4000)
strategy.exit("XL","ES", when = XS, loss=4000)
strategy.entry("EL", true, size, when = OL)
strategy.entry("ES", false, size, when = OS)
有任何想法吗?