You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Update 11 April 2024 - version 1.77
Speed-up of the GetDaylightSwitchTimes mehod. Now using a static array to memorize the switch times for the current year.
Update 12 April 2024 - version 1.80
Fixed issue in the calculation of the broker GMT offset on brokers that do not provide gold trading.
So they can be used as follows.
To check, you can then go to the broker at the desired DST/GMT and compare the real symbol with the custom symbol .
They should match, with only slight differences between bars (different brokers).
Update 15 April 2024 - version 1.82
Added SetCustomTimeZone method to CTimeZoneInfo class, which you can use to configure the built-in custom time zone with a specified name, an offset from Greenwich Mean Time (GMT) and a daylight schedule identifier. Later, the custom time zone can be accessed via ZONE_ID_CUSTOM.
I suggest writing the following functions.
Thanks for that nice idea.
However, I have implemented your idea differently in the library as a custom time zone that you can configure and use freely, like any other time zone.
Update 16 April 2024 - version 1.85
Replaced the GetNthSunday internal method with the more optimized GetMonthTime method.
Thanks for that nice idea.
However, I have implemented your idea differently in the library as a custom time zone that you can configure and use freely, like any other time zone.
Unfortunately, I couldn’t figure out from your source how I could write the following functions.
Forum on trading, automated trading systems and testing trading strategies
Libraries: Local Timezones and Local Session Hours
fxsaber, 2024.04.15 09:34
Could you tell me how to do it correctly?
fxsaber #:
Unfortunately, I couldn’t figure out from your source how I could write the following functions.
Could you tell me how to do it correctly?
Please refer to the code in post #26
I added a new timezone (ZONE_ID_CUSTOM) that you can configure with name, desired base GMT offset and a custom DST schedule of another timezone.
This custom time zone object once configured as you liking (e.g., custom broker), it will handle the updating of its current local time, dst timings, time conversion and text formatting, etc...
Here you convert bar times as given by your broker's time to the corresponding times of the hypothetical broker that we configured above, respecting its defined GMT offset and DST switch times.
The array on converted rates, is then used to display the price chart of the custom broker (or symbol).
The code above achieves the intent of your code:
NB:
Converting bar times from one broker to another causes the timelines (i.e., the simplified graph) of the bars to changes.
** Changing DST schedule changes the shape of the timeline of the weekly start hours of your broker:
** Changing only the GMT offset and keeping the same DST schedule causes shift of the timeline forward / back.
NOTICE: to accurately check those timelines, use the GOLD charts of the broker. They are more reliable for weekly start/end timing than Fx pairs that I found having a lot of variations/surprises.
Basic example of custom time zone:
You can read more about custom time zones in C# docs here: https://learn.microsoft.com/en-us/dotnet/api/system.timezoneinfo.createcustomtimezone?view=net-8.0