Indicators: iForexSessions

 

iForexSessions:

Highlights the Forex Market Sessions (Sydney, Tokyo, London, New York).

iForexSessions

Author: amrali

 
Thank you for your insight into the topic of time and for sharing.
 
fxsaber #:
Thank you for your insight into the topic of time and for sharing.

You are most welcome.

 
Thanx alot of the enlightenment, in the topic of time and sharing.
 
Thank you for sharing ,  I am in New Zealand  UTC+13 so it is actually very helpful for me . especially around daylight saving which will be this weekend. Much appreciated
 

Update 26 March 2024 - version 1.10

Added feature: 

Clicking on a chart bar while the 'Ctrl' key is pressed: the bar time (and corresponding times in major Forex markets) will be written to the 'Experts' log window for debugging.


 

Update 26 March 2024 - version 1.20

Changed feature:
Clicking on a chart bar while the 'Ctrl' key is pressed: the bar number # and its time (and corresponding times in major Forex markets) will be written to the chart window for debugging.
Then, to delete the debug info from the chart, just click anywhere on the chart (without pressing the 'Ctrl' key).



 
I came across the result of running this code.
   if(time == 0)
     {
      ChartSetSymbolPeriod(0,NULL,PERIOD_H1);
      return(0);
     }
This is a dangerous practice on charts with an EA.
 

Incorrectly determined the time offset.


I tried this code.

#include <fxsaber\Calendar\DST.mqh> // https://www.mql5.com/ru/code/32430

#define PRINT(A) Print(#A + " = " + (string)(A))

void OnStart()
{
  PRINT(DST::TimeServerGMT());
  PRINT(DST::TimeServerGMTOffset());
  PRINT(DST::GetRollover());
}


Result.

DST::TimeServerGMT() = 2024.03.29 04:53:36
DST::TimeServerGMTOffset() = -7200
DST::GetRollover() = 2024.03.28 23:00:00
 
fxsaber #:

Incorrectly determined the time offset.


I tried this code.


Result.

Thank you so much for your observation.

Currently, I'm working on a fix now.

 

Update 30 March 2024 - version 1.30

1. Fixed broker GMT offset. Currently, the CTimeZoneInfo library scans H1 bars only on the GOLD chart as it has the most accurate start times on all brokers that I have tested.

2. Fixed: the indicator no longer changes the chart's current timeframe. (Thanks @fxsaber for reporting bugs #1 and #2).

3. Changed feature: Moving the mouse pointer on a chart bar while the 'Ctrl' key is pressed: the bar number # and its time (and corresponding times in major Forex markets) will be written to the chart window for debugging. Then, to delete the debug info from the chart, just move the mouse anywhere on the chart (without pressing the 'Ctrl' key).

Reason: