ADD SOUND WAV TO AN 3MA (ALERT) INDICATOR

 

HI, everyone I'm kind of new here and I need help with adding a SOUND WAV to an indicator (3 MA Cross w Alert v2 mq4 for MetaTrader 4) I have tried without any success to add sound wav to it.

Thanks

 
jibolababy:

HI, everyone I'm kind of new here and I need help with adding a SOUND WAV to an indicator (3 MA Cross w Alert v2 mq4 for MetaTrader 4) I have tried without any success to add sound wav to it.

Thanks

Welcome to mql4.com forum,

Can you please show your attempt, so we can try to help you.

 

I was able to add these to the line and it works but if freezes MT4 because it alert every second any suggestion on the best way to make the indicator refreshes at a specified interval of timeframe?


if ((CrossUp[0] > 2000) && (CrossDown[0] > 2000)) { prevtime = 0; }

if ((CrossUp[0] == Low[0] - Range*0.5) && (prevtime != Time[0]) && (SoundAlert != 0))

Alert("Indicator set");

{

prevtime = Time[0];

Alert(Symbol()," 3 MA Cross Up @ Hour ",Hour()," Minute ",Minute());

}

if ((CrossDown[0] == High[0] + Range*0.5) && (prevtime != Time[0]) && (SoundAlert != 0))

Alert("Indicator set");

{

prevtime = Time[0];

Alert(Symbol()," 3 MA Cross Down @ Hour ",Hour()," Minute ",Minute());

}

 
jibolababy:

I was able to add these to the line and it works but if freezes MT4 because it alert every second any suggestion on the best way to make the indicator refreshes at a specified interval of timeframe?

...

Please use the SRC button when you post code. Thank you.

 
if ((CrossUp[0] > 2000) && (CrossDown[0] > 2000)) { prevtime = 0; }
      
      if ((CrossUp[0] == Low[0] - Range*0.5) && (prevtime != Time[0]) && (SoundAlert != 0))
      Alert("Indicator set");
       {
         prevtime = Time[0];
         Alert(Symbol()," 3 MA Cross Up @  Hour ",Hour(),"  Minute ",Minute());
       }
      
      if ((CrossDown[0] == High[0] + Range*0.5) && (prevtime != Time[0]) && (SoundAlert != 0))
      Alert("Indicator set");
       {
         prevtime = Time[0];
         Alert(Symbol()," 3 MA Cross Down @  Hour ",Hour(),"  Minute ",Minute());
       }
Sorry for that.
Reason: