I am wanting to capture the start of the of a Year, Quarter, Month and weekly, and sync this with the start of the session.
The issue, is that due to timezones, there are times when a NEW trading session starts, but the technical date(due to my timezone) has not rolled over yet.
An image is attached for the monthly. In this image, you can see how the FIRST triangle shows the first TRADING SESSION that would account for the first day of the NEW month. But my trading session, spans across two calendar days.
In general, I'd like to be able to sync the Year, Quarterly, Monthly and Weekly starts.
Capturing the calendar start can be done via:
Year: Time[0].Year ... E.g. 2024
Day Of Week: (int)Time[0].DayOfWeek ... E.g. 0-6
Quarter: (Time[0].Month-1)/3+1 ... E.g. 1-4
And then comparing the current bar, to the previous bar, and waiting for a change will yield the CALENDAR date of change.
Is there a best practices type of way to accomplish what I'm trying to accomplish.

Comment