I want to join 3 minute macd signal crossover alert on 3 minute timeframe. The alert should only be activated when 15 seconds macd is under zero line and macd crossover signal. Also same for when 3 minute macd signal crossunder alert on 3 minute timeframe, Alert should only be activated when 15 seconds macd is over zero line and macd crossunder
I already plotted the two macd on same pane which is displayed on the chart. My issue is the alert setting.
I used the code below to set my condition, but no alarm was triggered. Kindly advise. I am not a skilled programmer
macdupcrossAlert = ta.crossover(macd,signal) ///// 3 minute macd crossover
macddowncrossAlert = ta.crossunder(macd,signal) ////// 3 minute macd crossunder
macdcrossoverAlert_15S = ta.crossover(mtf_15smacd, mtf_15Ssignal) //// 15 seconds macd crossover
macdcrossunderAlert_15S = ta.crossunder(mtf_15smacd, mtf_15Ssignal) //// 15 seconds macd crossunder
condition1 = (macdcrossoverAlert_15S and mtf_15smacd < 0) and macdupcrossAlert
condition2 = (macdcrossunderAlert_15S and mtf_15smacd > 0) and macddowncrossAlert
alertcondition(condition1, title=”15 seconds up”, message=”Price is going up!, macd below zero”)
alertcondition(condition2, title=”15 seconds down”, message=”Price is going Down! macd above zero”)
olamide lolowo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.