I am working on a MTF Scanner for 20 assets. I have the script built and the alerts are triggering correctly, but only on the chart I set the alert on. I am trying to figure out why I am not getting alerts for all 20 coins, whenever the criteria is met.... I am not getting any errors at this point. Can anyone make any suggestions for me?
s01 = input.symbol( BTCUSDT , group = Symbols , inline = s01 )
GreenAnchor = GreenAreaCond
BlueAnchor = BlueAreaCond
RedAnchor = RedAreaCond
OrangeAnchor = OrangeAreaCond
GreenTrigger = GreenTriggerCond
RedTrigger = RedTriggerCond
AnchorTriggers = (GreenAnchor or BlueAnchor or RedAnchor or OrangeAnchor or GreenTrigger or RedTrigger)
AnchorTriggerConditions = (GreenAreaCond or BlueAreaCond or RedAreaCond or OrangeAreaCond or GreenTriggerCond or RedTriggerCond)
// Importing Data \
////////////////////////////// ~~~~~~~~~~~~~~~~~~ \\\\\\\\\\\\\\\
s01_TF1 = request.security(ticker.modify(s01, syminfo.session), TF(tf_period1, tf_multip1), AnchorTriggerConditions)
//ALERTS
alertcondition(bearCondition or bullCondition, title="Trending Bear or Bull", message="Background Changing to Green or Red, Price={{close}}, Trigger Timeframe={{interval}}, {{ticker}}, {{timenow}}")
alertcondition(enterLong or enterShort, title="Trigger Short or Long", message="Go Long or Go Short, Price={{close}}, Trigger Timeframe={{interval}}, {{ticker}}, {{timenow}}")
if bullCondition
alert_message1=(syminfo.ticker + " Background Changing to Green. Price: " + str.tostring(close) + ". Interval: " + timeframe.period + ".")
alert(alert_message1, alert.freq_once_per_bar_close)
else if bearCondition
alert_message2=(syminfo.ticker + " Background Changing to Red. Price: " + str.tostring(close) + ". Interval: " + timeframe.period + ".")
alert(alert_message2, alert.freq_once_per_bar_close)
if enterLong
alert(syminfo.ticker + " Long = TF1 Green and TF2 FSR 20 Crossover. (Price: " + str.tostring(close) + ". Interval: " + timeframe.period + ".", alert.freq_once_per_bar_close)
else if enterShort
alert(syminfo.ticker + " Short = TF1 Red and TF2 FSR 80 Crossunder. Price: " + str.tostring(close) + ". Interval: " + timeframe.period + ".", alert.freq_once_per_bar_close)