automatic validation issues

 
  • i have an EA, codeA.ex5 i have made all the necessary checks but this EA fails the automatic validation with errors(no trading operations) for all the test pairs 
  • when i copy the exact code and paste and compile with the same editor to codeB.ex5, this code passes the validation with no errors 
  • then i copy the code from codeB, modify the some few lines, to codeC.ex5. but codeC.ex5 fails automatic validation(no trading operations) too 
  • so i copy the exact code from codeB to codeC, with no modifications, but this code also fails automatic validation (no tradding operations) 
  • what is going on? any help?

this is the section of my code that places the pending orders

         double max_volume=SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_LIMIT);
         double current_lots=getAllVolume();  // get total volume of all positions and orders of current symbol

         if(orderType=="buy")
           {
            double orderTP = NormalizeDouble(orderEntry + ((orderEntry-orderSL)*rr), _Digits);
            double buyLot = calcLotSize(orderEntry, orderSL, ORDER_TYPE_BUY);

            if(max_volume>0 && max_volume-current_lots-buyLot<=0)
               return false;

            if(orderEntry-ask>=freezeLevel*_Point) // removing this line causes invalid price error
               result = m_trade.BuyStop(NormalizeDouble(buyLot, 2), NormalizeDouble(orderEntry, _Digits), _Symbol, NormalizeDouble(orderSL, _Digits), orderTP, ORDER_TIME_GTC, 0, "FVG");
           }

         if(orderType=="sell")
           {
            double orderTP = NormalizeDouble(orderEntry - ((orderSL-orderEntry)*rr), _Digits);
            double sellLot = calcLotSize(orderEntry, orderSL, ORDER_TYPE_SELL);

            if(max_volume>0 && max_volume-current_lots-sellLot<=0)
               return false;

            if(bid-orderEntry>=freezeLevel*_Point) // removing this line causes invalid price error
               result = m_trade.SellStop(NormalizeDouble(sellLot, 2), NormalizeDouble(orderEntry, _Digits), _Symbol, NormalizeDouble(orderSL, _Digits), orderTP, ORDER_TIME_GTC, 0, "FVG");
           }


Update:

i had this error trying to upload my EA


Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Operation Types
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Operation Types
  • www.mql5.com
Trade Operation Types - Trade Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5