Problem with multiplier

 
Hello,

I have problem with multiplier.

My code:

double getLastOrderTicket()
{
    datetime open = 0;
    double orderLots=0;
    
    
    for (int i = OrdersTotal() - 1; i >= 0; i--)
    {
        if (OrderSelect(i, SELECT_BY_POS))
        if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber  && (OrderType()==0 || OrderType()==1));
        {
            if (OrderOpenTime() > open) { open = OrderOpenTime(); }
            
            orderLots=OrderLots();
        }
    }
    return orderLots*LotMultiplier;
}
This code find last order and works. The problem is because no works Multiplier from my double LotMultiplier variable. If I use OrderLots*2 works.
 
Dejan Krapez: This code find last order and works.
It does not work correctly. It finds the latest OrderOpenTime, but the lot size of the order at the top of the list. Not necessary the same order.