emulate a MT server

 

good day everyone,

I would like to know if anyone has ever thought of and had success implementing an MT account server simulator,

to feed the ticks and real-time data from previously saved data. Perhaps this kind of tools exist already on the market, but I couldn't find any documentation on the communication protocol of MT.

I would like to create a simulator replaying historical data as if ticks were coming in real-time from a live account. This way we would be able to simulate real-life conditions and reply any data coming from different brokers, at any speed, slippage and trading conditions, etc.

Specifically I would like to implement it on MT5.

I know there are some "free simulator" out there, which hovewer only allow you to open and close positions during a running test and not to integrate your own EA along.

Also, after several tests, it turns out that they are not really able to follow the market as if it would be in real-time, for example the positions can be opened and closed manually while the simulation is running, but  the Stop limits are not triggered on time, making the simulation unreliable.


If this prject comes to life I will definitely share results and the community might be able to take advantage to better simulate our strategies in the real world, and not just limited to the MT tester.


Thanks in advance for any hint!

 
daruler:

good day everyone,

I would like to know if anyone has ever thought of and had success implementing an MT account server simulator,

Thanks in advance for any hint!

sounds just like the MT5 Strategy Tester to me.... why re-invent the wheel

 
Paul Anscombe #:

sounds just like the MT5 Strategy Tester to me.... why re-invent the wheel

for the reason explained above.

Plus, the strategy tester is not interactive. I would like to use my EA as an aid for manually opened positions (and therefore need to test it in several real-world scenarios), not as a full-automated strategy.


To explain it better: I normally do day-trading using this EA which helps me manage the open positions (setting SL,TP and TS and closing positions under certain criteria, but it does NOT open positions alone). Along this EA I'd like to use also several indicators to determine manually when to open positions, which would not be possible to include during a test through the buiilt-in Strategy tester (also, it would unnecessarily complicate the simulation).


Since I would like to replicate behaviour on past history events, I would need to "replay" data on my current MT profile setup, but as if they would come in real-time from a broker server. I hope this clarifies.

 
daruler:

good day everyone,

I would like to know if anyone has ever thought of and had success implementing an MT account server simulator,

to feed the ticks and real-time data from previously saved data. Perhaps this kind of tools exist already on the market, but I couldn't find any documentation on the communication protocol of MT.

I would like to create a simulator replaying historical data as if ticks were coming in real-time from a live account. This way we would be able to simulate real-life conditions and reply any data coming from different brokers, at any speed, slippage and trading conditions, etc.

Specifically I would like to implement it on MT5.

I know there are some "free simulator" out there, which hovewer only allow you to open and close positions during a running test and not to integrate your own EA along.

Also, after several tests, it turns out that they are not really able to follow the market as if it would be in real-time, for example the positions can be opened and closed manually while the simulation is running, but  the Stop limits are not triggered on time, making the simulation unreliable.


If this prject comes to life I will definitely share results and the community might be able to take advantage to better simulate our strategies in the real world, and not just limited to the MT tester.


Thanks in advance for any hint!

Hey ... I used to code something alike, I was even able to connect the terminal to an IRC server with - unfortunately I don't remember if/where it has been backup.

https://www.mql5.com/en/blogs/post/733860

When I did it, if I remember well there was no python support nor socket support on MT5, but today there's ...

https://www.mql5.com/en/docs/network/socketcreate

Any programming language to MQL / MQL to any programming language
Any programming language to MQL / MQL to any programming language
  • www.mql5.com
With a frontend it could also add an IRC client to MT
 
Icham Aidibe #:

Hey ... I used to code something alike, I was even able to connect the terminal to an IRC server with - unfortunately I don't remember if/where it has been backup.

https://www.mql5.com/en/blogs/post/733860

When I did it, if I remember well there was no python support nor socket support on MT5, but today there's ...

https://www.mql5.com/en/docs/network/socketcreate

Thanks for your message, but I have the feeling we are talking about different things here (unless you show me how this can apply).

The socket functions in MQL5 are about initiating connections and data transfers at client side within an EA specifically programmed for that (e.g.: outgoing data enquiries from MT to whatever other network interface), while I would need to emulate packet sending from server side, leaving my existing EA run as if it was receiving live data on a given instrument, ex. EURUSD or NASDAQ index.

It is really like about creating a virtual broker account which can feed custom ticks to a normally running MT. Only parameters to set on MT would be obviously the "virtual" broker credentials account to connect with. Ideally this server emulator should be runnig locally, no need for internet connection.


Purpose is to test my existing EA's as if it was in real-time (NOT the integrated stategy tester, as there must be an interaction with the user while ticks are coming) on known historical data and being able to change the time and tick speed at will.

There must be a way, as this is exactly how a real broker server work, but I appreciate this might be a sensitive argument reserved for a niche audience.

 
daruler #: It is really like about creating a virtual broker account which can feed custom ticks to a normally running MT. Only parameters to set on MT would be obviously the "virtual" broker credentials account to connect with. Ideally this server emulator should be runnig locally, no need for internet connection.Purpose is to test my existing EA's as if it was in real-time (NOT the integrated stategy tester, as there must be an interaction with the user while ticks are coming) on known historical data and being able to change the time and tick speed at will. There must be a way, as this is exactly how a real broker server work, but I appreciate this might be a sensitive argument reserved for a niche audience.

There is already a very well known 3rd party tool for the MT4 Strategy Tester and that feeds or injects the tick data on the fly, including floating spread (with or without padding), slippage and other market conditions in order to simulate real live trading, called Birt's Tick Data Suite.

However, the MT5 Strategy Tester already has most of these capabilities built in, so consider using MT5 instead of MT4.

Reason: