Hi I have EA with code structure like this,
void OnTick()
{
resetCounterVar(); //there's for loop
CloseOrders(); //there's for loop
UpdateAllOpenOrders(); //there's for loop
SetSLTP(); //there's for loop
CheckPendOrder(); //there's for loop
if(IsNewCandle() && pendingOrderCount<MaxPendingOrder)
OpenOrders();
}
I want to make the for loop instead for every function into like this,
for(int i = OrdersTotal() - 1; i >= 0; i--)
{
if(OrderSelect(i,SELECT_BY_POS) &&
OrderSymbol() == Symbol()
{
resetCounterVar();
CloseOrders();
UpdateAllOpenOrders();
SetSLTP();
CheckPendOrder();
if(IsNewCandle() && pendingOrderCount<MaxPendingOrder)
OpenOrders();
What I want to ask does the second code structure more efficient then the first one?