The problem not the sound.. You can use PlaySound("file_name.wav");
The problem is how to tell the stoploss event has been occurred..
Review this code:
https://www.mql5.com/en/code/11127

MQL4 OnTrade() Alternative
- votes: 6
- 2014.02.17
- Ahmed Soliman
- www.mql5.com
This code is an Alternative of the missing OnTrade() event in MQL4.
you must use Hidden StopLoss
i had a similar EA:
#resource "\\Files\\CASHREG.wav" string Sound; void OnInit() { ... Sound = "::Files\\CASHREG.WAV"; ... } // And then for playing the sound its just called as following, with the need of a conditional for the SL for example, when PositionTotal() has decreased or sth like that PlaySound(Sound);
Hope i helped you.
arnaud pizzirani:
hello
i would like to know how can i have a sound when a stoploss is triggererd
cause i'm not watching all the time my pc screen but i'm in the same room with speaker on.
thank you
edit: Alain if you around maybe ? merci
static int hot= OrdersHistoryTotal(); void OnTick() { //--- if(hot < OrdersHistoryTotal()) { hot= OrdersHistoryTotal(); PlaySound("alert.wav"); } }

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
hello
i would like to know how can i have a sound when a stoploss is triggererd
cause i'm not watching all the time my pc screen but i'm in the same room with speaker on.
thank you
edit: Alain if you around maybe ? merci