EA differnt result in tester and prop firm account

 

Hi all

My EA is different in teser and prop firm account. Please help


On 7 Sep, 2026,   the no. of lot increase by 1 in tester , but not in prop firm account


Prop firm account



The function is as follows:


int LastLotCnt()

{

   int re;

   

   long l_timecurrent = TimeTradeServer();   

   

   double l_profit_sum = 0;

   double l_profit = 0;

  

         

// history from "100 days before to current time

   if(!HistorySelect(l_timecurrent - 8640000 ,l_timecurrent))  

   {

      Print("Fail to get last lot");

      return -1;

   }

   

   

   int total = HistoryDealsTotal();

   

   if (total == 0) // No history deal

   {

      return 1;

   }

   

   for (int j = total - 1 ; j >= 0 ; j--) 

   {

      ulong ticket =  HistoryDealGetTicket(j);

      

      if (ticket <= 0) 

      {   Print("Failed to get ticket"); 

          continue;

      }

      

        

      long magicno;

      if (!HistoryDealGetInteger(ticket,DEAL_MAGIC,magicno)) 

      {   Print("Failed to get magic number"); 

          continue;

      }

      



      if (magicno == InpMagicNumber)

      {   

      

            long l_dealentry;

            if (HistoryDealGetInteger(ticket,DEAL_ENTRY,l_dealentry)) 

            { 

               if (l_dealentry == DEAL_ENTRY_IN)

               {

               

                  string comment;

                  if(HistoryDealGetString(ticket, DEAL_COMMENT, comment))

                  {

                    if (StringSubstr(comment,0,11) == "No of Lot =")        

                    {        

                       re =  (int) StringSubstr(comment,11,StringLen(comment) - 1);  



                       if (l_profit_sum < 0)

                       {   re = re + 1 + (re/5);

                       }

                                  

                       return re;

                       

                    }

                        

                  }

                          

               }

               else if (l_dealentry == DEAL_ENTRY_OUT)

               {

                  if (HistoryDealGetDouble(ticket,DEAL_PROFIT,l_profit))

                  {

                      l_profit_sum += l_profit;

                  }

               }

            }

         

    }

  }

  return -1; 

}

Peter.

 
You should provide a code where the string "No of Lot" is assigned, not where it's read from the comment, in order to troubleshoot. Apart from the comment difference, the lots seem executed very similar in the tester and online.