MACD Sound Indicator

takeashotlv

Trader
Nov 26, 2012
1
0
17
Hello!

Few days ago I made MACD Crossover alert indicator, but it won't work correctly. It shows only last few bars and line won't work correctly. I don't know how to make it work properly. Maybe someone can help me?
 

Attachments

First, you need to use brackets around each condition of multiconditional IFs. For example, this:
MQL4:
    if(SIGNAL_BAR > 0 && Time[0] <= PrevTime )
Should become this:
MQL4:
if((SIGNAL_BAR > 0) && (Time[0] <= PrevTime))

Second, do not do "return(0);" from the cycle that calculates your indicator values, use "continue;" instead.
 
Last edited: