如何解决目标订单未填写
我已经设置了我的代码,因此它会在未平仓头寸上贴上标签并继续存储目标和止损。问题是我的止损被正确击中,但我的头寸没有按目标平仓,即使价格已经远远超出我的价格
if(longCondition)
strategy.entry("Long Buy",true,1,comment ="Long Buy \n" + "Target is " + tostring(targetLR) + "\n" + "StopLoss is " + tostring(stopLR))
//label.new(bar_index,high,color = color.white)
if(strategy.position_size > 0)
targetLR := targetLR[1]
stopLR:= stopLR[1]
label.new(x= bar_index,y= high,text = tostring(targetLR) +"\n" + tostring(stopLR),textcolor = color.white)
strategy.exit("Long Buy",limit = targetLR,comment = "Take Profit")
strategy.exit("Long Buy",stop = stopLR,comment = "Book Loss")
strategy.close_all(when = closing_Bell,comment = "Closing Bell")
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。