Hello everybody,
I need your help. I code a Program with two brokers respectively two MT4 Instances.
The program opens a Buy Trade on Broker1 and a Sell Trade on Broker2 at a specific time.
So in the next step I am going to close all trades at a later time.
Both trades have to close at 0€. This means: if the Sell Trade is -0.20 € we have to close the Buy Trade at +0.20€.
The program may only stop trading if both instances come out at 0€.
Example:
How can I best program this? I know I need the Mql4-Api. But the beginning is difficult for me, how do I program it e.g. in C #?
When you need to create applications spawning multiple brokers I guess you have to either use some third-party API like MetaApi or code the communication between MetaTrader terminal instances in MQL language. It is up to you to choose, but the advantage of external API is that you can use any programming language you know so that you can implement the app faster and of higher quality.
- metaapi.cloud
When you need to create applications spawning multiple brokers I guess you have to either use some third-party API like MetaApi or code the communication between MetaTrader terminal instances in MQL language. It is up to you to choose, but the advantage of external API is that you can use any programming language you know so that you can implement the app faster and of higher quality.
But how i can programming the communication in MQL4? I need only the Signal: Broker 1 and Broker2 Orders Profit is 0. Then i Close the Trades and i have no Profit or Losses. Both MT4 instances run on a Windows server.
I think it should be possible to use filesystem API calls and exchange data between MT terminals via filesystem. Check https://docs.mql4.com/files/fileopen and https://www.mql5.com/en/articles/503.
- docs.mql4.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello everybody,
I need your help. I code a Program with two brokers respectively two MT4 Instances.
The program opens a Buy Trade on Broker1 and a Sell Trade on Broker2 at a specific time.
So in the next step I am going to close all trades at a later time.
Both trades have to close at 0€. This means: if the Sell Trade is -0.20 € we have to close the Buy Trade at +0.20€.
The program may only stop trading if both instances come out at 0€.
Example:
How can I best program this? I know I need the Mql4-Api. But the beginning is difficult for me, how do I program it e.g. in C #?