The DayOfWeek() function return wrong value when the local time of the chart data is not UTC +00.
I attached 2 example charts with local time that is UTC +08. The instruments are Hangseng index and Xinhua index. In the bottom of the chart I added an indicator to display DayOfWeek().
From the datetime time line you can see the dayOfweek() retun value is out of sync with the date by 8 hours.
For chart with local time UTC +00, the DayOfWeek() is in sync with the date. See XBTUSD .
Is this a bug?