EA OnTick() fuction run even when automated Trading is off?

 

Hello,



Even when Automated Trading setting is turned off, EA functions are getting called. Is this normal? or it due to some error?.


if((!Close_Buy_Limit) && Buy_Limit && trades_count(BuyLimitMagic) == 0 && istochastic_16 > up_level)
        {
         ResetLastError();
         gTicket = OrderSend(Symbol(), OP_BUY, Lot_Size, Ask, Slippage, StopLoss_BuyEntry, TakeProfit_BuyEntry, (BuyLimitTradeComment + trades_count(BuyLimitMagic)), BuyLimitMagic, 0, White);
         if(_LastError != ERR_NO_ERROR && _LastError != ERR_NO_MQLERROR)
            Print("Initial Buy Limit Order Error Code : " + GetLastError());
        }
      if((!Close_Sell_Limit) && Sell_Limit && trades_count(SellLimitMagic) == 0 && istochastic_16 < lo_level)
        {
         ResetLastError();
         gTicket = OrderSend(Symbol(), OP_SELL, Lot_Size, Bid, Slippage, StopLoss_SellEntry, TakeProfit_SellEntry, (SellLimitTradeComment + trades_count(SellLimitMagic)), SellLimitMagic, 0, Aqua);
         if(_LastError != ERR_NO_ERROR && _LastError != ERR_NO_MQLERROR)
            Print("Initial Sell Limit Order Error Code : " + GetLastError());
        }
 
It's normal. The only thing is it won't open or close or modify a position/order automatically via EA.
Reason: