Download MetaTrader 5
To add comments, please log in or register
Why to sell products in MetaTrader AppStore? Find that out from the article!
jibolababy
12
jibolababy 2014.02.28 22:00 

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

Alain Verleyen
Moderator
28522
Alain Verleyen 2014.02.28 23:32  
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.

jibolababy
12
jibolababy 2014.03.02 22:41  

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());

}

Alain Verleyen
Moderator
28522
Alain Verleyen 2014.03.03 00:03  
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.

jibolababy
12
jibolababy 2014.03.03 02:56  
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.
/
To add comments, please log in or register