I looking for a kind of interface from to run MT5 on my MT4 Live accout.
Is anybody doing or knowing about something like that ?
You may be able to use WinAPI to write files on trade signal from MT5 to MT4 experts\file folder. Then MT4 reads trade signal and executes trade.
Here is an example of file write. Courtesy of https://www.mql5.com/en/forum/118999
#property show_inputs #include <WinFile.mqh> // User configurable test values to write and then read extern int WriteInt1 = 1234567890; extern int WriteDouble1 = 12345.6789; extern int WriteInt2 = 9876543210; extern int WriteDouble2 = 9876.54321; int start() { string strTestFilename = "c:\\temp\\test.dat"; int fWrite = OpenNewFileForWriting(strTestFilename, true); if (!IsValidFileHandle(fWrite)) { MessageBox("Unable to open " + strTestFilename + " for writing"); } else { // Write the four parameters in the order int-double-int-double WriteIntToFile(fWrite, WriteInt1); WriteDoubleToFile(fWrite, WriteDouble1); WriteIntToFile(fWrite, WriteInt2); WriteDoubleToFile(fWrite, WriteDouble2); CloseFile(fWrite); } int fRead = OpenExistingFileForReading(strTestFilename); if (!IsValidFileHandle(fRead)) { MessageBox("Unable to open " + strTestFilename + " for reading"); } else { if (ReadIntFromFile(fRead) == WriteInt1) { if (ReadDoubleFromFile(fRead) == WriteDouble1) { if (ReadIntFromFile(fRead) == WriteInt2) { if (ReadDoubleFromFile(fRead) == WriteDouble2) { MessageBox("The two ints and doubles were successfully read back from the file!"); } else { MessageBox("Read of double 2 failed"); } } else { MessageBox("Read of int 2 failed"); } } else { MessageBox("Read of double 1 failed"); } } else { MessageBox("Read of int 1 failed"); } CloseFile(fRead); } }
- www.mql5.com
You may be able to use WinAPI to write files on trade signal from MT5 to MT4 experts\file folder. Then MT4 reads trade signal and executes trade.
Here is an example of file write. Courtesy of https://www.mql5.com/en/forum/118999
thank you for the example,
sounds good, in principle I like.
Do you expect some delays in executing orders by this method or is it negligible ?
Should I synchronize writing and reading ?
My first idea would by OnTick / start fctn's but maybe I underestimate something...
thank you for the example,
sounds good, in principle I like.
Do you expect some delays in executing orders by this method or is it negligible ?
Should I synchronize writing and reading ?
My first idea would by OnTick / start fctn's but maybe I underestimate something...
Since the FileWrite and FileRead are on same PC or server. execution time should not be extensive. You can add a TimeCurrent() date to MT5 FileWrite and then execute a TimeCurrent() on MT4 FileRead or OrderSend() to find Signal transfer time. You will need to assure MT4 only executes one trade and does not get caught in a repeating OrderSend() loop for same signal. Most EAs are already coded to prevent this.
The order-loop problem is a good issue.
I think with a additional line in the file with a kind of counter or fingerprint this problem can be fixed by th MT4 read function.
I will give you feedback if its realized.
Thanks in advance.
The order-loop problem is a good issue.
I think with a additional line in the file with a kind of counter or fingerprint this problem can be fixed by th MT4 read function.
I will give you feedback if its realized.
Thanks in advance.
For as near as possible replication on MT5 performance on MT4 terminal, the MT5 will need to write all trade operations,ie; order open, order close, order modify and market stops. Here is an example I had coded to Allow only one instance of an EA running. Hope it might help with ideas.
- www.mql5.com
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I looking for a kind of interface from to run MT5 on my MT4 Live accout.
Is anybody doing or knowing about something like that ?