Try doing "Inter-process" communication between EA and scripts.
the simplest way to achieving this is via isuing the commands/parameters onto a file and the slave process to fetch the parameters there.
Just have those scripts running all over on another chart (any charts). and each script homed for a particular filename.
ie, script ABCDE.mq4 looks for file ABCDE.txt file for commands
ie, script XYZ.mq4 looks for XYZ.txt file for commands.
.
.
.
.
.
its that simple!
the simplest way to achieving this is via isuing the commands/parameters onto a file and the slave process to fetch the parameters there.
Just have those scripts running all over on another chart (any charts). and each script homed for a particular filename.
ie, script ABCDE.mq4 looks for file ABCDE.txt file for commands
ie, script XYZ.mq4 looks for XYZ.txt file for commands.
.
.
.
.
.
its that simple!
thanks for your response, but that's not what I want. :(
here is a quote from another forum how to do a workaround:
Is this the only way? Slawa, what do you think about it?
here is a quote from another forum how to do a workaround:
quoting "jhernandez": You can assign a hotkey to your script, and then have your EA simulate 'pressing' the hotkey which will trigger your script to run as a process outside of your EA. That way the EA and the script are independent of each other.
This should give you a 'poor mans' version of multi threading in Metatrader.
This should give you a 'poor mans' version of multi threading in Metatrader.
Is this the only way? Slawa, what do you think about it?
Ahh yes, the "HOT KEY" approach.
I personally would not recommend doing this. You need to have your MT4 focused all the time. AND secondly, the Script will execute only on the highlighted/focused Chart. IF you have your EA running on 5 pairs, and you want to delegate some commands to another script, how do you think your EA running on EURUSD, invoke an external script to run for EURUSD too when the focused chart is GBPUSD? Your EA will invoke the script to run on GBPUSD! Likewise, you dont even have any "parameters" to pass to this script.
Buttom line, this will be a wrong way to doing it. Of course you can go on with this suggestion and dig up on kernel32.dll for ways to "PUSH KEYS" into the keyboard buffer.
Again, this hotkey solution SUCK. While there is no formal way given by Metaquotes to solve your problem, the "file solution" *IS* the best way to go.
I personally would not recommend doing this. You need to have your MT4 focused all the time. AND secondly, the Script will execute only on the highlighted/focused Chart. IF you have your EA running on 5 pairs, and you want to delegate some commands to another script, how do you think your EA running on EURUSD, invoke an external script to run for EURUSD too when the focused chart is GBPUSD? Your EA will invoke the script to run on GBPUSD! Likewise, you dont even have any "parameters" to pass to this script.
Buttom line, this will be a wrong way to doing it. Of course you can go on with this suggestion and dig up on kernel32.dll for ways to "PUSH KEYS" into the keyboard buffer.
Again, this hotkey solution SUCK. While there is no formal way given by Metaquotes to solve your problem, the "file solution" *IS* the best way to go.
OK, thanks man. :)

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
Second question about Init(), could it be that if I even use return(-1) the init still executes OK and EA runs? How can I kill the EA if something is wrong and exit it for good? So that it wouldn't execute on next tick again..