PlaySound (Reserved Word)
This reserved word finds and plays the specified sound file (.wav file). The value of True is returned if the sound file was found and played. The value of False is returned if the file is not found or cannot be played.
Condition1 = (PlaySound(FileName));
FileName is any text string expression that represents the full path and file name of the sound file to be played. Only .wav files can be played.
Remarks
The specified file must be a *.wav audio file.
Notes
We recommended that you use this reserved word only on the last bar of the chart, otherwise, you may find that the .wav file is played more often than you intended. For example, if your intention is to play a .wav file whenever a certain bar pattern occurs, and this pattern occurs 50 times in the price chart, the trading strategy, analysis technique, or function will play the .wav file 50 times when it is applied to the price chart. Also, the .wav file is only played once per bar, even if the event occurs more than once intrabar (unless the Update value intra-bar option is enabled, in which case, the .wav file will play with each new tick while the event is True).
Example
Condition1 = (PlaySound("c:\sounds\Thatsabuy.wav"));
This statement plays the sound file Thatsabuy.wav that resides in directory c:\sounds.
Additional Example
The following statements play the sound file Thatsabuy.wav when there is a key reversal pattern on the last bar of the chart:
if LastBarOnChartEx and Low < Low[1] and Close > High[1] then
Condition1 = PlaySound("c:\sounds\Thatsabuy.wav");