Discussion of article "Cross-Platform Expert Advisor: Introduction"

 

New article Cross-Platform Expert Advisor: Introduction has been published:

This article details a method by which cross-platform expert advisors can be developed faster and easier. The proposed method consolidates the features shared by both versions into a single class, and splits the implementation on derived classes for incompatible features.

Note that the two source files shown earlier are identical. It is not possible to have a single source file that is cross-platform compatible. This is due to how the source files are being compiled:

  • Compiling an MQ4 source file results to the generation of an EX4 file
  • Compiling an MQ5 source file results to the generation of an EX5 file.

It may not be possible to have a single source file that works on both platforms. However, it is possible to have both source files to reference a single header file, as what is illustrated in the following figure:

Source and Header Files

Author: Enrico Lambino

 

Great article: easy to read, all the ideas are clear and even your own appear...

 
The idea (cross-platform) is correct. But here it is proposed to create a certain meta-language and use it to write cross-platform Expert Advisors. The meta-language seems superfluous in this solution, because you can write everything in MQL4. And the Expert Advisors should run not only on MT4, but also on MT5. There is such a solution in kodobase. In particular, with this solution, old MQ4 codes can be launched in MT5 by adding one encludnik. In general, creating a meta-language seems less universal and even superfluous. However, it would be interesting to see the continuation of the series of articles on this topic. Hopefully, sysov labour won't come out.

As for the Introduction itself. The example with StringConcatenate cuts me off. It is hard to understand people who use this function in MT4/5. Not only is it cumbersome, but it's also not clear. String concatenation has ALWAYS been achieved in both platforms through the + operator. So using StringConcatenate for strings is comparable to using the "NumberSummary" function to get the sum of numbers. Absurd, in short.

If I understood correctly, this is a translation of the article. That's why you should write to the original to contact the author. English version?
 
https://www.mql5.com/ru/code/16006
MT4Orders
MT4Orders
  • votes: 11
  • 2016.08.05
  • fxsaber
  • www.mql5.com
Параллельное использование ордерных систем MetaTrader 4 и MetaTrader 5.
 
fxsaber:
The idea (cross-platform) is correct. But here it is suggested to create a certain meta-language and use it to write cross-platform Expert Advisors. The meta-language seems superfluous in this solution, because you can write everything in MQL4. And to run EAs not only on MT4, but also on MT5.
If I understood correctly, this is a translation of the article. Therefore, to contact the author, apparently, you need to write to the original. English version?
Yes
 
MetaQuotes Software Corp.:

Published article Cross-platform trading advisor: Introduction:

Author: Enrico Lambino

I'm sorry, but what the hell is the point of this?
 
Yuriy Asaulenko:
I'm sorry, but what's the point?
So you don't have to do any porting.
 
A cross-platform Expert Advisor can be created only if it is based on a cross-platform trading engine, where the trading API and data access will be replaced by OO-versions, the internal implementation of which will be determined by macros #ifdef __MQL5__. Considering the above, the author's article is at least naive. Of course, it is great that the author discovered the #ifdef __MQL5__ macro, but it is not enough by itself. You need to write an engine with #ifdef at every step, and this is much more complicated.