Download MetaTrader 5

Sound for stoploss

To add comments, please log in or register
Looking for like-minded people? You will find lots of them on the Forum!
arnaud pizzirani
664
arnaud pizzirani 2015.10.30 15:29 

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  

Mohammad Soubra
24925
Mohammad Soubra 2015.10.30 18:28  
use Alert() function
Ahmed Soliman
15714
Ahmed Soliman 2015.10.30 22:39  

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
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.
Siti Latifah
6450
Siti Latifah 2015.10.31 03:36  

you must use Hidden StopLoss

kerso4
203
kerso4 2015.10.31 12:34  
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.
Yerlan Imangeldinov
1030
Yerlan Imangeldinov 2015.10.31 21:28  
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"); 

}


}
To add comments, please log in or register