Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
//-- 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.