New article: Cross-Platform Expert Advisor – Reuse of Components from the MQL5 Standard Library

 

New article Cross-Platform Expert Advisor: Reuse of Components from the MQL5 Standard Library has been published:

There exists some components in the MQL5 Standard Library that may prove to be useful in the MQL4 version of cross-platform expert advisors. This article deals with a method of making certain components of the MQL5 Standard Library compatible with the MQL4 compiler.

Similar to what was discussed in the first article, we use a common header file which would, ideally, consolidate the similarities in code between the MQL4 and MQL5 versions. It is actually possible to rewrite the CSymbolInfo class into three separate files so that the similarities can be shared in a single file, and the differences be coded in the other two class files. However, in this article, we will deal with the easier (and faster) approach: copy the MQL5 CSymbolInfo class file, and then comment the lines that incompatible with MQL4. For both versions, however, the resulting file structure would look like the following:

SymbolInfo file structure

Author: Enrico Lambino

Reason: