有没有一种更简单的方法来创建和买卖订单,并带有一个尾随止损



我试图构建一组非常简单的带有止损和尾随止损的买入/卖出命令。有更聪明的方法吗?

//@version=5
strategy("Buy/Sell Order with Trailing Stop", overlay=true, margin_long=100, margin_short=100)
strategy.entry ("L1", strategy.long, qty = 10, limit = 88, stop = 86)
strategy.exit ("S1", "L1", strategy.short, qty = 10, limit = 98, stop = 100, trail_price=1)
strategy.entry ("L2", strategy.long, qty = 10, limit = 86, stop = 84)
strategy.exit ("S1", "L2", strategy.short, qty = 10, limit = 96, stop = 100, trail_price=1)

例如,您可以添加一些inputs。看看策略的例子,例如https://www.tradingview.com/script/IHVPG6TS-Stop-loss-and-Take-Profit-in-example/

最新更新