是否有一个选项可以在pine脚本上设置,以便在提交新的命令时,它会取消之前未实现的命令?
if secondbuycond and firstbuycond and (time >= testPeriodStart and time <= testPeriodStop)
strategy.entry("buy", strategy.long, stop=((valuewhen(firstbuycond,open,0))*x))
strategy.exit("Trailing Stop", "buy", trail_points= trailPoints, trail_offset= trailOffset, when= testType == 'Trail Points')
//@version=3
strategy("My Strategy", overlay=true)
limit_price = 0
ts = timestamp(2018, 11, 13, 0, 0)
if (time > ts)
limit_price := 999
ts2 = timestamp(2018, 11, 22, 0, 0)
// here new price will be set to replace an order
if time > ts2
limit_price := 988
strategy.entry("BUY", strategy.long, limit=limit_price)
可以用新价格替换再次输入,但两个条目必须仅在价格上有所不同(因此订单ID和方向必须相同)我在CHMF中测试了上面的策略,即每日分辨率。