Discussion of article "MQL5: Create Your Own Indicator"

 

New article MQL5: Create Your Own Indicator is published:

By describing creation of True Strength Index, the author shows how to write indicators in MQL5.

The second version of True Strength Index indicator looks better

Author: MetaQuotes

 
Isn't there a bug that the calculation of the indicator (starting from MTM buffers) is performed ignoring the begin parameter? It was mentioned that the user can apply the indicator to another arbitrary indicator, and not the fact that there will be data there.
Документация по MQL5: Основы языка / Функции / Функции обработки событий
Документация по MQL5: Основы языка / Функции / Функции обработки событий
  • www.mql5.com
Основы языка / Функции / Функции обработки событий - Документация по MQL5
 
marketeer   :

Isn't there a bug that the calculation of the indicator (starting from MTM buffers) is performed ignoring the begin parameter? It was mentioned that the user can apply the indicator to another arbitrary indicator, and it is not a fact that there will be data there.
You are absolutely right, this point is not reflected in the article. I will have to add the corresponding paragraph to the article and code as soon as possible, otherwise there will be questions. Thanks.
 
Perhaps only a warning will be added, as otherwise the article will become too complicated for the first acquaintance. This point will be reflected in the next forthcoming article.
 
Thank you for the traditionally clear presentation. I would like to read more about advisors and new products in your text.
 
Happy NY. Can you tell me if MQL5 debugger is planned to work in indicators? Cps
 
AdwareRu   :
Happy NY. Can you tell me if MQL5 debugger is planned to work in indicators? Cps

Yes, it will.

 
Rosh   :

Yes, it will.



That's very gratifying
 

Dear Mr Umarov!

Professional developers please understand  that most  traders are not professional coders and find it very hard to get things done.

With MQL5 it's even harder. 

The trader who wants to learn to work with MT5 needs articles like this to understand how to do it. 

Please write more articel like this. Thank's a lot for htis one. 

regards

walb 

 

Very good! Thank you !

Teach our newbies step by step.

I have a question,

is it necessary or more proper to add the below code ?

ArraySetAsSeries(price,true);

 

   for(int i=1;i<rates_total;i++)
     {
      MTMBuffer[i]=price[i]-price[i-1];
      AbsMTMBuffer[i]=fabs(MTMBuffer[i]);
     }

 

Why use [i-1] to calculate [i] and start i=1 ?  no [0] ?

  MTMBuffer[i]=price[i]-price[i-1];