指定
I am currently running MT4 on my system with charts for 24 currency pairs with several indicators. I also have source code for the indicator I need to link to to this DLL.
Non-circumstantial information
I have an indicator that successfully fires the PlaySound event and plays a WAV file when I should open and/or close a trade according to my Business Plan, Indicator triggers, etc.
The problem
When price action is such that I have several events trigger at the same time, the MT4 PlaySound event gets jammed and tries to play several WAV files simultaneously. Then all hell breaks loose! For the next several minutes the same PlaySound events try to repeat themselves. Not good, not what I envisioned!
My Solution
I have three different events where sound bites should be played. I will quote the words I recorded in the individual WAV files, and you'll immediately see what I mean:
- Prepare to Buy (or Sell) EURUSD
- Buy (or Sell) EURUSD
- Close EURUSD
These three files exist for all 24 currency pairs, and inside of my Indicator, I have triggers where I fire the PlaySound event. Instead, I want to fire the command to a dll that will receive "DLL PLAY SOUND" events from 1 - n currency pair charts and manage the sound events as follows:
I expect to send two parameters to the single external function sequencedSound(string wavFileName, int Heirarchy) of the dll.
I need the events sorted according to a 0 - 10 hierarchy so that I can for instance send all Close Order events as 0 level events 0 being most important, 10 least important. If more than one 0 level or 3 level events come in while the queue is working on playing other events, then FIFO will work with a 5 second delay behind all events. 60 seconds (or as soon as the queue is empty) later, the same sound file should be replayed.
The DLL will default into the \Sound folder under the MT4 installation.
I do not expect the DLL to need to work with multiple MT4 or any MT5 installations.
Note: I will manage how often I send DLL Play Sound requests inside of the Indicator