Check for Trading session

 

How can I check a symbol if it is in trading Session?

SymbolInfoSessionTrade should generally do the job, however, as I remember, some days before big holiday, trading session end earlier then usual days, so  SymbolInfoSessionTrade is not suitable.

I tried to use Trade Mode, but it alway show Full Access even now, now is weekend for currency. I was hoping it show No Access.

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

How can I check a symbol if it is in trading Session?

SymbolInfoSessionTrade should generally do the job, however, as I remember, some days before big holiday, trading session end earlier then usual days, so  SymbolInfoSessionTrade is not suitable.

I tried to use Trade Mode, but it alway show Full Access even now, now is weekend for currency. I was hoping it show No Access.

you can check if OnTick() function is being executed.. add some variable there, counting ticks.. if there is tick, there is trading session happening.. 

as a suggestion, use the Timer() function to reset the same counter variable, under some time range.. this way you can have control about receiving ticks....