Discussion of article "Library for easy and quick development of MetaTrader programs (part IX): Compatibility with MQL4 - Preparing data"

To add comments, please log in or register
MetaQuotes Software Corp.
Moderator
208933
MetaQuotes Software Corp.  

New article Library for easy and quick development of MetaTrader programs (part IX): Compatibility with MQL4 - Preparing data has been published:

In the previous articles, we started creating a large cross-platform library simplifying the development of programs for MetaTrader 5 and MetaTrader 4 platforms. In the eighth part, we implemented the class for tracking order and position modification events. Here, we will improve the library by making it fully compatible with MQL4.

Improving the library

In the DoEasy library root folder, create the new ToMQL4.mqh include file. Here we will describe all necessary constants and enumerations for MQL4. Include it to the Defines.mqh file for MQL4 compilation at the very beginning of the Defines.mqh listing:

//+------------------------------------------------------------------+
//|                                                      Defines.mqh |
//|                        Copyright 2018, MetaQuotes Software Corp. |
//|                             https://mql5.com/en/users/artmedia70 |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, MetaQuotes Software Corp."
#property link      "https://mql5.com/en/users/artmedia70"
//+------------------------------------------------------------------+
//| Include files                                                    |
//+------------------------------------------------------------------+
#ifdef __MQL4__      
#include "ToMQL4.mqh"
#endif               
//+------------------------------------------------------------------+

After that, the entire MQL4 library will be able to see what is written in the ToMQL4.mqh file during compilation.

Let's move to the very beginning of the error list in the Errors tab of the Editor's Toolbox by pressing NumPad Home or by simply scrolling up to the very start. Double-click the very first error:

Author: Artyom Trishkin

To add comments, please log in or register