Discussion of article "MQL5: Create Your Own Indicator" - page 2

 

minor comment:

In the article on the website where it says "Only the calculation of values for the TSIBuffer[] array needs to be optimised, but this is not difficult to do in the same way as was used for MTMBuffer[].
" "

Here comes the code :

//--- now let's calculate the indicator values
   if(prev_calculated==0) start=r+s-1; // set the initial index for input arrays
   for(int i=start;i<rates_total;i++)
     {
      TSIBuffer[i]=100*EMA2_MTMBuffer[i]/EMA2_AbsMTMBuffer[i];
     }
//--- return value of prev_calculated for next call
   return(rates_total);

where you need to add the value of the start variable if prev_calculated is not equal to 0. This missing point is present in the source.

 
Diver:

where it is necessary to add the value of the start variable if prev_calculated is not equal to 0. This missing point is present in the source code.

nothing is missing. the code for start is above.
 
sergeev:
nothing is missing. the code for start is above.

you should look at the code I've given and compare it with the source.

you need to add :

else start=prev_calculated-1;

 
Diver:

you should look at the code I gave you and compare it with the source.

you need to add :

else start=prev_calculated-1;

why do it repeatedly?

this repeated line is in the source, but it is not critical to the algorithm.

 
sergeev:

and why do it again?

there is this repeated line in the source, but it is not critical to the algorithm.

Yes, indeed.
 

I can't find this article through Articles - Indicators. It has also disappeared through Examples - Indicators. It was just a few days ago.

From bookmarks it opens normally.

 
Silent:

I can't find this article through Articles - Indicators. It has also disappeared through Examples - Indicators. It was just a few days ago.

From bookmarks opens normally.

Everything seems to be normal, in place:

Статьи по MQL5: Индикаторы
Статьи по MQL5: Индикаторы
  • www.mql5.com
Статьи по программированию на языке MQL5
 

It was like this. After looking, there was an update, it's now 4 pages there, and the article is back up.

 
Attached source code files and source code insets in HTML code are now completely translated into Portuguese for your convenience.
MQL5.community - User Memo
MQL5.community - User Memo
  • 2010.02.25
  • MetaQuotes Software Corp.
  • www.mql5.com
You have just registered and most likely you have questions such as, "How do I insert a picture to my a message?" "How do I format my MQL5 source code?" "Where are my personal messages kept?" You may have many other questions. In this article, we have prepared some hands-on tips that will help you get accustomed in MQL5.community and take full advantage of its available features.