need help HistoryDeals messed up !!

 

I am trying to print the history symbols are type along with date

however the results are completely messed up

time of deals are not matching the history ,tickets,  type of buy and sell are not matching (i assume it return 1 for buy and 0 for sell)

can anyone check my code and tell me what am i doing wrong ??

i tried shifting the period by 1 to go back another day, same problem


datetime history=iTime(Symbol(),PERIOD_D1,0); 
   HistorySelect(history,TimeCurrent()); //Selecting history period 
for(int i=0;i<HistoryDealsTotal(); i++)
   
         {
          ulong ticket=HistoryDealGetTicket(i);
      
          datetime daa=HistoryDealGetInteger(ticket,DEAL_TIME);
           
          {Print (ticket+"  "+HistoryDealGetString(ticket,DEAL_SYMBOL)+"  "+daa+"  "+HistoryDealGetInteger(ticket,DEAL_TYPE));}         
         }
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Deal Properties
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Deal Properties
  • www.mql5.com
Deal Properties - Trade Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 

As far as I see in the doc there are two parameters required for HistorySelect

https://www.mql5.com/en/docs/trading/historyselect

Documentation on MQL5: Trade Functions / HistorySelect
Documentation on MQL5: Trade Functions / HistorySelect
  • www.mql5.com
HistorySelect - Trade Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Yashar Seyyedin #:

As far as I see in the doc there are two parameters required for HistorySelect

https://www.mql5.com/en/docs/trading/historyselect

yes and thats what is done

 
Mohamed Mostafa Mohamed Sonbol #: yes and thats what is done

Why do you have two MQL5 Community accounts? It is a violation of the Terms and Conditions

12.11. The User shall use only one unique MQL5 ID on the www.mql5.com website. In case additional/repeated User accounts are detected, all of them shall be closed. MetaQuotes Ltd also reserves the right to invalidate all payment transactions made from additional/repeated accounts.