You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
//-- 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.