我正在弄乱用 pinescript v5 编写的交易视图策略。 我想实施多重止盈策略。该策略工作正常但不是我想要的 100%。
我有这个简短的退出逻辑:
strategy.exit("S-TP-1","short" ,limit=short_tp_1,qty_percent = 10,comment = "TP1") strategy.exit("S-TP-2","short" ,limit=short_tp_2,qty_percent = 10,comment = "TP2") strategy.exit("S-TP-3","short" ,limit=short_tp_3,qty_percent = 10,comment = "TP3") strategy.exit("S-TP-4","short" ,limit=short_tp_4,qty_percent = 10,comment = "TP4") strategy.exit("S-TP-5","short" ,limit=short_tp_5,qty_percent = 10,comment = "TP5") strategy.exit("SL-Short","short" , stop=short_sl,qty_percent = 100, comment="SL")
问题:
止损被击中,策略不满仓退出。 他只关闭了 50% 的头寸。这是因为我对10%的TP使用限价单。
有没有办法在触及止损的情况下取消限价订单并全仓卖出?