pine-script,strategy.exit在条件上不起作用

时间:2018-04-19 11:12:01

标签: tradingview-api pine-script

有条件。

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)

任何想法?

0 个答案:

没有答案