Download MetaTrader 5

Who can help me?

To add comments, please log in or register
gingaiulian
42
gingaiulian  

I use one indicator who can put buy and sell signal on the chart, ok now i whant to put in indicator a code to playsound alert when he put that sell and buy signal on the chart, i put playsound(alert.wav) code inside he work but the problem is he play that sound continuously without stoping, how to make it to play that sound only one time for each signal ?

Thank's a lot guys!

mohsin
86
mohsin  

can u use alert function?

gingaiulian
42
gingaiulian  
mohsin360:

can u use alert function?


IT WILL BE THE SAME PROBLEM. The indicator work on everytick taht way for every tick make a playsound .
Tjipke de Vries
6384
Tjipke de Vries  
gingaiulian:

IT WILL BE THE SAME PROBLEM. The indicator work on everytick taht way for every tick make a playsound .


So you know what it is you have every tick playsound

avoid that it happens

whroeder1
15913
whroeder1  
gingaiulian: whant to put in indicator a code to playsound alert when he put that sell and buy signal on the chart,
Play your sound when you put a NEW signal on the chart, not just when the signal is true.
gingaiulian
42
gingaiulian  
Yes WHRoeder, but how to do that ?
whroeder1
15913
whroeder1  
gingaiulian: Yes WHRoeder, but how to do that ?
  1. You code it. IF no signal previous bar and signal last bar Sound. OR if signal { if buffer[0] == EMPTY_VALUE Sound; buffer[0] == signal; } Are those too hard?
  2. You have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
okwh
1638
okwh  

1) should record time when 1st play.

2) check the different between that record time when signal, only play when this different large enough,

3) if play, update that record time

To add comments, please log in or register