How to limit a trigger to only one trade/entry, and after an exit not generate another entry from the same trigger?
I solved it by using:
b = ta.barssince(id2)
tradesActively = ((strategy.closedtrades - strategy.closedtrades[b]) < 1)
Variable id2
is the trade setup condition.