Discussion of article "Extending MQL5 Standard Library and reusing code"

 

New article Extending MQL5 Standard Library and reusing code has been published:

MQL5 Standard Library makes your life as a developer easier. Nevertheless, it does not implement all the needs of all developers in the world, so if you feel that you need some more custom stuff you can take a step further and extend. This article walks you through integrating MetaQuotes' Zig-Zag technical indicator into the Standard Library. We get inspired by MetaQuotes' design philosophy to achieve our goal.

In a nutshell, MQL5 API is intended for you to benefit from code reuse, reliability, flexibility and easy maintenance. This is what the theory says, but beyond all this, if you plan to continue to advance in MQL5 to develop more sophisticated things, such as multi-currency Experts Advisors, you should first be able to code in the Standard Library way so that your apps are guaranteed a successful life. As your EAs and indicators become more and more complex, it is more necessary to master the concepts involved in a framework development. As a real life example, it is my personal need to develop a complex multi-currency EA which dictates the need of strengthening the base of my project from scratch.

Figure 2. We start downloading MetaQuotes' ZigZag from our MT5 Terminal

Author: Jordi Bassaganas

 

Thank you. Very informative.

 

I try to understand what this code means in this article why we have an * near the CINDICATOBUFFER and then use at.  

 

((CIndicatorBuffer*)At(0)).Name("ZIGZAG");
      ((CIndicatorBuffer*)At(1)).Name("HIGH");
      ((CIndicatorBuffer*)At(2)).Name("LOW");

 

I would appreciate a detail explanation

 

thanks  

 
rodlivar:

I try to understand what this code means in this article why we have an * near the CINDICATOBUFFER and then use at.  

 

((CIndicatorBuffer*)At(0)).Name("ZIGZAG");
      ((CIndicatorBuffer*)At(1)).Name("HIGH");
      ((CIndicatorBuffer*)At(2)).Name("LOW");

 

I would appreciate a detail explanation

 

thanks  

* indicates a pointer. Detailed explanation in this article Using the Object Pointers in MQL5
 
I read this article (and this https://www.mql5.com/en/forum/335975 and this https://www.mql5.com/en/articles/5) during a bug fix session related to custom indicator buffers, I finally fix it when I realized that only one buffer can set with INDICATOR_DATA flag, otherwise CopyBuffers/GetData returns always -1 except for the first indicator flagged as INDICATOR_DATA.
Thank you.
Example of how to use CiCustom
Example of how to use CiCustom
  • 2020.03.27
  • www.mql5.com
After some in depth debugging, I realized I've been using CiCustom wrong...
Reason: