help - how to only read back 8 bars

 

I only want my ea to read back 8 bars , here is my code but its not working , seems it reads all the bars ...

int start_bar = Bars;
//Print (start_bar);
for (int bar = start_bar; bar >= 0; bar--) {
//if (bar > 8) break;
value = (iClose(NULL,0,bar));
//Print (value);
//Print("bar= ",bar);
.
.
.
.
.
.

 
buju:

I only want my ea to read back 8 bars , here is my code but its not working , seems it reads all the bars ...


int start_bar = Bars;
//Print (start_bar);
for (int bar = start_bar; bar >= 0; bar--) {