Hi, I am looking into changing my current trading setup from using multiple instances of MT4 to creating microservices in python.
The idea is to have python scripts (bots) running with my algorithms that can execute trades on multiple accounts at multiple brokers at the same time.
Long term I would like the system to be scalable. So when I have more bots and more accounts that I can just add additional servers when I need them. The whole thing should be scriptable so that I can automate the creation of bots and load balance the system dynamically. Therefore I would love to do that with python on linux, also as I am familiar with those.
As far as I understand right now, there are the following options to proceed:
- Go via the APIs from the brokers. My preferred approach, as I would be independent of MT5 and Windows/Wine.
- Go via a tool like https://github.com/khramkov/MQL5-JSON-API to communicate through MT5
- Use python on Windows and use the python library for MT5 (https://pypi.org/project/MetaTrader5/)
Questions that I have:
1) Not all brokers seem to provide an API and I would have to implement each API. Is this correct? Or is there a way to use the API that MT5 uses?
2) Do I need to have an instance of MT5 running for each account/broker?
Or can I execute multiple orders on multiple accounts in one MT5 instance at the same time?
The MQL5-JSON-API tool seems not to support multiple accounts.
3) How much overhead is involved using the python library? Can I make hundreds of calls to multiple accounts without worrying about performance?
And could I create my own python proxy on Windows that delegates the requests from my linux bots?
Has anyone experience on how to approach this?
Thanks a lot.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, I am looking into changing my current trading setup from using multiple instances of MT4 to creating microservices in python.
The idea is to have python scripts (bots) running with my algorithms that can execute trades on multiple accounts at multiple brokers at the same time.
Long term I would like the system to be scalable. So when I have more bots and more accounts that I can just add additional servers when I need them. The whole thing should be scriptable so that I can automate the creation of bots and load balance the system dynamically. Therefore I would love to do that with python on linux, also as I am familiar with those.
As far as I understand right now, there are the following options to proceed:
Questions that I have:
1) Not all brokers seem to provide an API and I would have to implement each API. Is this correct? Or is there a way to use the API that MT5 uses?
2) Do I need to have an instance of MT5 running for each account/broker?
Or can I execute multiple orders on multiple accounts in one MT5 instance at the same time?
The MQL5-JSON-API tool seems not to support multiple accounts.
3) How much overhead is involved using the python library? Can I make hundreds of calls to multiple accounts without worrying about performance?
And could I create my own python proxy on Windows that delegates the requests from my linux bots?
Has anyone experience on how to approach this?
Thanks a lot.