error extracting session closing time

 

Hi all, with the following code I'm trying to extract the session closing time for DE30.pro (OANDA).

  int session = 1;

  MqlDateTime DateTimeStructure ; 
  
  TimeToStruct(time_local,DateTimeStructure);
  
  ENUM_DAY_OF_WEEK Day_of_week = ENUM_DAY_OF_WEEK(DateTimeStructure.day_of_week);
      
  if(SymbolInfoSessionTrade(_Symbol,Day_of_week,session,from,to))
    {
    Print(TimeHour(to)) ;
    Print(TimeMinute(to)) ;  
    }

When I use Print function the result is 0 for Hour instead of 21 and 0 for Minutes instead of 59. 

Could you help me? Thank you!

 
Alberto Tortella:

Hi all, with the following code I'm trying to extract the session closing time for DE30.pro (OANDA).

When I use Print function the result is 0 for Hour instead of 21 and 0 for Minutes instead of 59. 

Could you help me? Thank you!

session needs to be zero. They are zero indexed.