New article Ready-made Expert Advisors from the MQL5 Wizard work in MetaTrader 4 has been published:
The article offers a simple emulator of the MetaTrader 5 trading environment for MetaTrader 4. The emulator implements migration and adjustment of trade classes of the Standard Library. As a result, Expert Advisors generated in the MetaTrader 5 Wizard can be compiled and executed in MetaTrader 4 without changes.
On the EURUSD M15 chart, the Expert Advisor trading looks good, including the way it sets the stop loss and take profit levels.
A chart window, demonstrating the work of an EA from the MetaTrader 5 Wizard in MetaTrader 4
Author: Stanislav Korotky
Good day Mr Stanislav Korotky, I hope you are doing good.
I have find you article very interesting and I have try to follow your instruction on how make a ready-made MT5 EA be compatible to run in MT4.
But I getting the following error, could you please guide me on how to resolve the error?
what I did after following your instruction was: I just copy the MQL5 source file and the MQL5 Program then follow by pasting it into the main directory of Expert folder
and I got so many error.
Could you tell me how can I proceed on making the generated EA of MQL5 work in MT4?
Bellow are the attached error images.
I don't understand what you mean. You need to unzip the provided patch for MT4 library into MQL4/Include folder. MT5Bridge.mqh header is also required.
How did you get the source code of your expert adviser in MQL5? Only experts generated by MQL Wizard are supported.
After some investigation of the use-case above I can now make a note:
MetaEditor can compile both MQL4 and MQL5, but MQL5 internally provides many built-in types which will interfere with emulated types introduced in the MT5Bridge.mqh. This will not and is not intended to compile.