Discussion of article "How to Write an Indicator on the Basis of Another Indicator"

 

New article How to Write an Indicator on the Basis of Another Indicator is published:

In MQL5 you can write an indicator both from a scratch and on the basis of another already existing indicator, in-built in the client terminal or a custom one. And here you also have two ways - to improve an indicator by adding new calculations and graphical styles to it , or to use an indicator in-built in the client terminal or a custom one via the iCustom() or IndicatorCreate() functions.


Author: Дмитрий

 

When compiling it gives the following error: 'LinearWeightedMAOnBuffer' - wrong parameters count tsis.mq5 155 10

To fix it, it is necessary to:

1. pre-calculate the sum of LWMA_weight weights:

int LWMA_weight=0;
for(int j=1; j<=sp; j++)
   LWMA_weight+=j; // Increase LWMA_weight by j

2. pass LWMA_weight as the last parameter to the LinearWeightedMAOnBuffer function;

LinearWeightedMAOnBuffer(rates_total,prev_calculated,begin2,sp,TSIBuffer,TSISigBuffer,LWMA_weight)
 
Eugeniy Medvedev:

...

Thank you for your constructive input