Any idea how to add atr based stops/take-profits in a strategy script ? I can't reference the strategy(entry) function because it cannot be declared as a variable. thanks
You can use stop parameter in strategy.entry to define stop any value .
To take profit you can have something like
tp = 10
if (strategy.position_size > 0)
strategy.exit(id="TakeProfit", from_entry="Long", profit=takeProfitAtValue)