"invalid index buffer number in iCustom function" question. - page 3

 

@Simon:

2. "I don't know where you have seen "result transmission" so i don't know it's context, I guess it means the returning of the returned value."

I am using "MQL Navigator" and "Toolbox" (both are contained within standard "MetaEditor").

Type: "Return operator" inside your "MQL Navigator" contained within your MetaEditor.

Thank you.

 

@ Simon:

Both "SECTION 1" and "SECTION 2" are located below start function of "MAonMA v2".


SECTION 1:

int limit = Bars-counted_bars;

"Bars" = large number of about 1000+ (must be the bars on the chart).

"counted_bars" = IndicatorCounted();



SECTION 2:

if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;

//...

for(i=0; i<limit; i++)
   
   { a[i] = iMA(NULL, 0, ma_period1, 0, ma_method1, ma_appliedprice1, i); }



// I am only using one of the three "for operations" in order to understand "MAonMA v2" processes.
// I have "deactivated" the other two for now.

I understand each value that has been assigned to "limit" and "counted_bars".

"i" is integer data-type and it is used in an array, "a[i]".

I do not understand how the functions-

if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;

and-

for(i=0; i<limit; i++)
   
   { a[i] = iMA(NULL, 0, ma_period1, 0, ma_method1, ma_appliedprice1, i); }

-correlate.

Please explain this correlation and share your thoughts regarding this.

Thank you.

 
WhooDoo22:

I do not understand how the functions-

if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
Contradictory information on IndicatorCounted() - MQL4 forum
Reason: