I have followed the answer Here to implement a Stop-Loss and Take-Profit by percentage in one script as a strategy as the code is shown.
However, now I wanna convert this strategy into an indicator v5 (study v4) adding alert functionality to it.
I used this code to trigger an alert once the enterLong condition is met however how to set the TP and SL with the same alert?
Is it possible to create one alert with TP and SL avoiding multiple alerts per trading pair, especially since TradingView's maximum allowed alerts are 400 which will be fully consumed?
Remark I'm using TP% and SL% and might include leverage not only spot trading.
alertcondition(enterLong, title="LONG", message = "long sl=SLPerc tp=TP1Perc")