I'm experimenting with a semi-automated strategy (automated signals but manual trade execution) and I'd like to use a specific sound file (.wav) per market to know on which market a signal occurs, as the strategy is deployed on over 20 markets and I don't have enough space on my screens to display them all.
I've worked with sound alerts in the past and they're very convenient, but the thing I'm trying to do now is a little more complex as I want to develop a generic code that can be applied to all markets and will then recognise the specific market where a signal occurs and play the market-specific sound file.
Example:
A signal occurs in the NQ, I want the strategy to play the "NQ.wav" sound file,
A signal occurs in the ES, I want the strategy to play the "ES.wav" sound file, etc
I know how to code market-specific commands using the
Instrument.MasterInstrument.Name == "ES" function and I also know how to play sound files using the
PlaySound("ES.wav") command, I just don't know how to combine the two in order to create a generic code that plays market-specific sound alerts in a more efficient way than this:
if(Instrument.MasterInstrument.Name == "ES")
PlaySound("ES.wav");
if(Instrument.MasterInstrument.Name == "NQ")
PlaySound("NQ.wav");
etc.
Any pointers would be much appreciated.
Thanks
Comment