launching MT4 with EAs and currencies from the command-line

 

Hi,

I run several (50+) sessions of MT4 simultaneously, and I find the process of individually opening each MT4 with 3+ EAs to be quite tedious. Is there any way to specify which currencies and EAs would run in each session of MT4 from the command-line? On a separate note, is it possible to launch an MT4 script from the command-line, while MT4 is already running?

Thanks!

 
vgoklani:

I run several (50+) sessions of MT4 simultaneously, and I find the process of individually opening each MT4 with 3+ EAs to be quite tedious. Is there any way to specify which currencies and EAs would run in each session of MT4 from the command-line? On a separate note, is it possible to launch an MT4 script from the command-line, while MT4 is already running?

The answer to your two separate questions is yes, albeit via a slightly roundabout route in both cases.

However, if you are running "50+" copies of MT4 then this almost has to be some sort of commercial undertaking (e.g. managed copies of MT4 on clients' behalf). It may not be entirely logical given that everyone is ultimately on this forum for financial gain, but I suspect that you're going to get a limited response. You're asking what appears to be a blatantly for-profit question, in a niche area, on a forum where you have no track record of contributing to the community.

To give you some background from the other perspective, there have been long debates on this forum about the degree of advertising which is permissible. Your question seems to be the flip-side of the same thing.
 
I am not a commercial undertaking (!), just a guy trying to scalp the forex market! I decided to run 50 different variations of my strategy to see if I could map the volatility over the week. A lot of my strategies work one day and then collapse afterwards... Believe me, trying to load MT4 50 times on your own home-made computer is really painful... anyway, hopefully someone else will be nice enough to give me some hints.
 
vgoklani:
I am not a commercial undertaking (!), just a guy trying to scalp the forex market! I decided to run 50 different variations of my strategy to see if I could map the volatility over the week. A lot of my strategies work one day and then collapse afterwards... Believe me, trying to load MT4 50 times on your own home-made computer is really painful... anyway, hopefully someone else will be nice enough to give me some hints.

If you are not a commercial? Why do not you open only 4-5 sessions with 30 charts on each At the same time solve the problem you wrote: "Believe me, trying to load MT4 50 times on your own home-made computer is really painful... "
 

well, because each session runs on a single execution thread. So while one EA is waiting for a trade confirmation, the other EAs are blocked from trading. This makes it difficult to scalp...

 

i'm sorry but it's a weak excuse, Write the EA to run on a multiple execution (& as i said before At the same time solve the problem you wrote: "Believe me, trying to load MT4 50 times on your own home-made computer is really painful... ")

 
Simply running three EAs in a single MT4 leads to the dreaded "Trade Execution Busy" message. How would one use 30?
 

than use IsTradeContextBusy()

 

It would never trade if I had to wait that long, that's the point of using so many sessions! Obviously each of my EAs sleep for a few milliseconds when "IsTradeContextBusy() == true", but it would never trade if I ran 30. That's why I run three EAs in 50, most of which go bankrupt, and so I need to create new demo accounts too.

Anyway, perhaps you could help me with another question. I have a very simple script which outputs my trades, (outputResults) and I would like to run it once per day. Is there an intelligent way of making it run automatically at say 9am? I could just keep checking the time, and then have it run when the current time equals 9am. But that seems like a huge waste of cpu time, I was wondering if there was something more clever.

 

What comes to mind right now is, to set hotkey for the script & Write a program that will be run with Task Scheduler at the time you want, to activate the trminal & use send key (hotkey)

(I'm sure there are better ideas than that but that's what comes to mind right now)

 
that's a good idea, but I was looking for something more general. I was hoping to find a way to make use of the Windows DLL framework and talk directly to MT4.
Reason: