Trading time of an instrument

 

Hi everyone,

is there a function or simple already made code that would result in number of minutes instrument is traded in a day? Par example, UKOil is traded from 3:05 to 23:50 and forex pairs from 0:05 to 23:55.

Regards,

 

Yes! You should reference the documentation when in doubt ...

Documentation on MQL5: Market Info

SymbolInfoSessionQuote

Allows receiving time of beginning and end of the specified quoting sessions for a specified symbol and day of week.

SymbolInfoSessionTrade

Allows receiving time of beginning and end of the specified trading sessions for a specified symbol and day of week.

Documentation on MQL5: Market Info
Documentation on MQL5: Market Info
  • www.mql5.com
Market Info - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5