I have a strategy which needs to alert on the actual candle where the buy/sell signal occurs. By default Trading View only alerts on the next candle, so I’ve tried adding calc_on_every_tick which did what I need, however generated too many alerts in a row “Alert was triggered too often and stopped”
Note I’ve also tried with either freq_all or freq_once_per_bar
What’s the best approach to have an alert trigger during the candle where the buy/signal first prints?
Is my current approach the way to go, if so, can we code so the alert only fires on the first time and exit?
strategy(title='Combined indicators', shorttitle='COMBIND', overlay=true, calc_on_every_tick = true)
// Code continues
............
//ALERT
if buyCondition and not buyCondition[1]
alert(long, alert.freq_all)
//alert(long, alert.freq_once_per_bar)
else if sellCondition and not sellCondition[1]
alert(short, alert.freq_all)
// alert(short, alert.freq_once_per_bar)