Download MetaTrader 5

Who can help me?

To add comments, please log in or register
Share your knowledge. Become a well-known developer!
gingaiulian
45
gingaiulian 2013.12.08 13:00 

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 2013.12.08 13:07  

can u use alert function?

gingaiulian
45
gingaiulian 2013.12.08 13:10  
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
6314
Tjipke de Vries 2013.12.08 13:26  
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
14470
whroeder1 2013.12.08 15:09  
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
45
gingaiulian 2013.12.09 07:17  
Yes WHRoeder, but how to do that ?
whroeder1
14470
whroeder1 2013.12.09 17:24  
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
1631
okwh 2013.12.18 14:43  

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