【发布时间】:2019-03-23 13:48:11
【问题描述】:
我在策略测试器中有以下代码,当它在 300 止盈期间自动退出时,它总是再次进入。退出触发时如何阻止它重新进入
isShort=false
isLong=false
if (goLong)
if(isShort==false)
strategy.entry("Long", strategy.long,100000,when=isShort?false:true)
strategy.exit("b1","Long",profit=300)
isShort:=true
isLong:=false
else
if(isLong==false)
strategy.entry("Short", strategy.short,100000,when=isLong?false:true)
strategy.exit("b2","Short",profit=300)
isShort:=false
isLong:=true
【问题讨论】:
标签: pine-script