Help needed: would like to access account history real-time

 

Hi Gurus,

I'm new to MT4 & MQL, so forgive me if I'm asking the obvious.

I'd like to access my Account History data as real-time as possible form a new app I'm developing. As far as I see I can't directly access the MT4 servers (AFAIK the APIs are not public), so I'd have to do something in the MT4 client, in MQL4. I *think* it should be a special EA, but not sure about it -- and that is the real question: how shall I approach this problem.

I have 3 (later 5) accounts with the same FOREX company and I'd like to get (in real-time, cca. as soon as the MT4 clients get it) the account history data of these accounts. DDE does not seem to be good, since does not provide this data. A .CSV file (or rather one for each account) would be fine (best would be some externall calls, e.g. a DLL). Is this something that should be done with an EA? Is this possible at all? I have seen scripts that produce an export, but those require manual work, and this should be automated 24/5 (on a VPS).

Any ideas?

All help much appreciated.

Cheers,

Peter

 
 
RaptorUK:
Take a look here: https://www.mql5.com/en/forum/106972


Hi RaptorUK,

Thanks for that link, it is an excellent pointer to how to export the actual list. Now the question is: how do I run this (1) automated & 24/5, (2) real-time, and (3) on multiple accounts.

Any ideas?

Thanks,

Peter

 
pietro:


Hi RaptorUK,

Thanks for that link, it is an excellent pointer to how to export the actual list. Now the question is: how do I run this (1) automated & 24/5, (2) real-time, and (3) on multiple accounts.

Any ideas?

Thanks,

Peter


For (3) multiple accounts, the MultiTerminal may be a solution (researching now) but (1) & (2) are definitely open questions...
 
pietro:


Hi RaptorUK,

Thanks for that link, it is an excellent pointer to how to export the actual list. Now the question is: how do I run this (1) automated & 24/5, (2) real-time, and (3) on multiple accounts.

Any ideas?

Thanks,

Peter

  1. build this kind of functionality into an EA
  2. an EA is real time(ish) as long as you have ticks
  3. place the EA on a chart open on each account

 
RaptorUK:

  1. build this kind of functionality into an EA
  2. an EA is real time(ish) as long as you have ticks
  3. place the EA on a chart open on each account


Thanks again, RaptorUK. So fundamentally this will be an EA. Great! With that 1 & 2 are taken care of as you indicated. I'm a bit confused about 3, but that must be my inexperience with MT4: as far as I see it allows only one account to be logged in, but I'll play with it and see what's possible. (BTW MultiTerminal was a dead end: does not allow scripting at all :( )

Zillion thx,

Peter

 
pietro:


Thanks again, RaptorUK. So fundamentally this will be an EA. Great! With that 1 & 2 are taken care of as you indicated. I'm a bit confused about 3, but that must be my inexperience with MT4: as far as I see it allows only one account to be logged in,

Ah I see, you can have 3 instances of the Terminal, one for each account, simply install to different directories . . .
 

RaptorUK:
Ah I see, you can have 3 instances of the Terminal, one for each account, simply install to different directories . . .

Good point, thx! It is kind of a resource hog, but will work :)
Reason: