Home Technical Indicator Post

Mastering the Trade Sessions Indicator for MetaTrader 5

Attachments
86.zip (1.96 KB, Download 0 times)

If you're looking to enhance your trading game, the Trade Sessions Indicator for MetaTrader 5 is a handy tool you won't want to miss. This indicator is built on the DRAW_FILLING buffers, allowing you to visualize trading sessions more effectively.

One of the great things about this indicator is its simplicity. It doesn’t come with a complex set of input parameters, relying instead on the TimeTradeServer() and TimeGMT() functions to keep you on track.

Trade Sessions Indicator

Keep in mind, though, that the trading session times might not always be spot on. They’re derived from the first source I found, so feel free to tweak the constants for your specific needs. The GMT time serves as the baseline here.

// Time constants are specified across Greenwich
const int   AsiaOpen=0;
const int   AsiaClose=9;
const int   AsiaOpenSummertime=1;   // The Asian session shifts
const int   AsiaCloseSummertime=10; // after the time changes
const int   EuropaOpen=6;
const int   EuropaClose=15;
const int   AmericaOpen=13;
const int   AmericaClose=22;

Additionally, you can take advantage of summer time changes using the TimeDaylightSavings() function. While it’s still a bit basic, it’s a step in the right direction.

//+--------------------------------------------------------------------+
// Summertime determination is reserved for the future calculations
//+--------------------------------------------------------------------+
bool Summertime(datetime time)
{
   if(TimeDaylightSavings()!=0)
      return(true);
   else
      return(false);
} 

So, once the clocks spring forward for summer time, all historical data will reflect the time shift. This can be quite handy for keeping your analysis accurate!

The first version of this indicator was rolled out on MQL4, paving the way for traders to better navigate the market’s ebb and flow.

Related Posts

Comments (0)