ObjectsTotal() & OrdersTotal() for-loop array ?

 

//-- loop total horizontal lines on main chart

for(int i=ObjectsTotal(0,-1,OBJ_HLINE); i>=0; i--)

//

this should begin a count on horizontal lines beginning with 0 if there are no horizontal lines ??

and this means that if there were no horizontal lines that it would process the for loop with no object ??

//

the documentation says it returns the amount of objects - not that there is an array with 0(0 objects?)


now, what about this..


//-- loop open positions

for(int i=OrdersTotal(); i>=0; i--)

//

this is not unlike the ObjectsTotal() and would mean there is an ordertotal of 0 that could process a loop ??


so shouldn't these be like this ?? ::

//

for(int i=ObjectsTotal(0,-1,OBJ_HLINE); i>0; i--)

&

for(int i=OrdersTotal(); i>0; i--)

//

..the loop will not process if there are no objects or orders.

 
  for(int i=ObjectsTotal(0,-1,OBJ_HLINE)-1;i>=0;i--)

if there are no objects then i's initial value will be -1 and the loop will not be executed.

 

no objects or orders the value is 0.0

Ok thank you!

Reason: