You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I really appreciate that. Actually, this is an EA. I am just trying to send an e-mail, or play a sound in the middle of my EA, but looks like it is impossible:) If I write this small program in a script it works fine, but when I write it in an EA, it doesn't work.
Might have something I am missing here. Any clue would be must welcome.
Thanks again folks.
Init() runs whenever you attach your EA (this is the point of it), but start() will only run first on the first new tick: this is important!
Let's say I want to send an e-mail every time a new H4 bar starts. That seems very simple, but I have no clue how to do it. Please, which code should I put in my EA? Thanks again all of you folks.
Ok.... I would like to say that the e-mail is working properly now. thank you guys for the help.
How did you get the email to work??? I have yet to see a documented "How to..." for setting up the email function.
Let's say I want to send an e-mail every time a new H4 bar starts. That seems very simple, but I have no clue how to do it.
I intend create an indicator that plays sound for 10 seconds say and then stop besides creating objects when a criterion presents itself. In the piece of code in src I have tried using either an Alert() with Playsound(NULL) or Playsound(Alert.wav) with Playsound(null)
The problem I am facing is that once the playsound(Alert.wav) or the Alert() is activated and the sound plays and it doesn't stop at all in both the methods. Apparently the way I have coded and used the Playsound(NULL) along with a timer that I created is not doing what I expect for example <if((int)TimeNow-(int)Time[barind-1]>90000) { PlaySound(NULL); Print(__LINE__," NULL HIT @diff ", (int)TimeNow-(int)Time[barind-1]); }>
The second issue is that when the PlaySound(Alert.wav) is activated I intend to create a popup that gives me an option to stop the music being played by clicking a button, or something to that effect that enables a manual close earlier than 10 seconds.
I have used (int) before all time parameters in order for the time to convert into milliseconds. Also, I have modified the Alert.wav file to include 1 hour long jazz music for example.
Any inputs and suggestions would be apppreciated.
You can only use Alert function, no need to use PlaySound function.
- Rename the file 'alert.wav' in folder 'C:\Program Files (x86)\... MetaTrader4\Sounds' to 'temp.wav'
- Copy the sound file '*.wav' to the folder 'C:\Program Files (x86)\... MetaTrader4\Sounds'
- Rename the sound file '*.wav' to 'alert.wav'