thank you everybody who helped!
here it is:
when we have no arrays - works basic formula:
limit = MathMin(limit, MaxBarsToCount);
but when we have 4ex. MAonArray - we need more bars (MA period) to count first MaonArray bar:
MaxBarsToCount + MA period
macd limit test3.gif
so, two ways possible- count more or draw less:
- draw MaxBarsToCount but count more
limit = MathMin(limit, MaxBarsToCount)+ MA period
- or count the same but draw less
SetIndexDrawBegin(i,Bars-MaxBarsToCount+MA period);
_____
in all cases SetIndexDrawBegin in "int start()" not at "init()" section
for (i=0;i<indicator_buffers;i++) SetIndexDrawBegin(i,Bars-MaxBarsToCount + MA period);
return(0);
}