A question on mt4 programming

 

void start

{

.......;

for i=1000, i>0, i--

{

a[m]=close;

m++;

}

.......;

.......;

}

in this example, will i calculate the "for" loop for 1000 times every time i receive new quotation? if so, how can i avoid it?

 
huaxia009:
void start

{

.......;

for i=1000, i>0, i--

{

a[m]=close;

m++;

}

.......;

.......;

}

in this example, will i calculate the "for" loop for 1000 times every time i receive new quotation? if so, how can i avoid it?

int counted_bars=IndicatorCounted();

limit = Bars-counted_bars;

for(i=0;i<limit;i++) {

........

 
thorr:
int counted_bars=IndicatorCounted();

limit = Bars-counted_bars;

for(i=0;i<limit;i++) {

........

thanks a lot.

but this method can also be used in expert advisor?

 
thorr:
int counted_bars=IndicatorCounted();

limit = Bars-counted_bars;

for(i=0;i<limit;i++) {

........

i know how to do!

thanks very much!