Divergence of OsMA Indicator Consultation

 

Hi,

I'm studying this indicator but I don't understand some lines. Please someone who explain it to me. ¿Where is my error?

First the function "FractRightBars" is equal to 1.

extern int FractRightBars = 1;

I think than the function "limit" is equal to 2  because:

IndicatorCounted() = Bars - 1 = counted_bars   then,

counted_bars-- = Bars - 2   then,

limit = Bars - (Bars - 2) = 2

int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;

Here is my problem in the loop of fractals,

for(i=1+FractRightBars; i<limit; i++)

The loop begin in i = 1+1 = 2,

with increments of one at a time until the condition i<limit = 2.

What am I doing wrong?

Thanks.

Files:
 

Perseuz:

I think than the function "limit" is equal to 2  because:

IndicatorCounted() = Bars - 1 = counted_bars   then,

The first time counted_bars == 0 so it loops from 1+1 to all a bars. After that counted_bars = Bars -1 so limit = 1 and nothing happens.

Do it right. ALWAYS count down to zero. FractRightBars does not belong in the main loop. It's in the sub loop.

 
WHRoeder:

The first time counted_bars == 0 so it loops from 1+1 to all a bars. After that counted_bars = Bars -1 so limit = 1 and nothing happens.

Do it right. ALWAYS count down to zero. FractRightBars does not belong in the main loop. It's in the sub loop.



Thanks for your response.

I agree with you in "The first time counted_bars == 0 so it loops from 1+1 to all a bars." But I don't understand what you say next.

In the second time, counted_Bars == Bars-1

In this second time, ¿which values are taken by the variable "i" in the loop?

for(i=1+FractRightBars; i<limit; i++) {

PD: Excuse mi english.

Reason: