How to get an audile alarm when a trade is executed

 
Since I use an expert, different instances on different charts, I would like to hear a audible alarm from the MT5 platform on PC when a trade is executed.
Since I work from home, this alarm would give me the opportunity to do other thing while the experts are executed.
I just find it strange that I can't find any answer here on MQL5 and on the internet in general, for something so simple.
Thanks for the help.
 

Use Playsound in the code

PlaySound

It plays a sound file.

bool  PlaySound(
   string  filename      // file name
   );

Parameters

filename

[in]  Path to a sound file. If filename=NULL, the playback is stopped.

Return Value

true – if the file is found, otherwise - false.

Note

The file must be located in terminal_directory\Sounds or its sub-directory. Only WAV files are played.

Call of PlaySound() with NULL parameter stops playback.

PlaySound() function does not work in the Strategy Tester.



 

Thanks for the response.
If I got it right, this code has to be inserted in the expert?

Isn't there a general switch button in MT that allow to play a sound if a buy of sell order is activated?
Thanks again.

 
erikefox #:

Thanks for the response.
If I got it right, this code has to be inserted in the expert?

Yes, it should be coded so that when a buy/sell is opened the sound is played.

 
erikefox #: Isn't there a general switch button in MT that allow to play a sound if a buy of sell order is activated?

No, there is not! By default, the sound is only played during manual trading, or when an EA is coded to so as well. However, there are push notifications for trade operations.

 
I checked and enabled all the sound options in MT5, including Tools/Options/Events. Seems that the EA (Expert) has to be changed.
Thanks for the help and have a nice evening (Belgium time)