Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I live in Hong Kong and sometimes find the trading hours of different exchanges very confusing. I therefore wrote this indicator which displays the trading session of different timezones. It also draws a new time x-axis of the exchange timezone.
If you cant find the pre-defined timezone, you can use custom_local_gmt and custom_exchange_gmt to configure your own timezones.
note that this indicator does not automatically check daylight saving.
Did you pay attention to the different daylight savings times?
Europe has different dates for switching from standard time to summer time than the US. As far as I know, Japan has no daylight savings times schedule at all.
The necessary methods are now all available with .NET 3.5., which was not the case with .Net 2.0, so you can easily use them to determine the correct values for the variable exchange_gmt which you use in your indicator code.
Thanks Fattails. I am not sure if i can code that, I only know how to code in Ninja (and VB), I have put in for example NewYork_EST and NewYork_EDT in the exchange_timezone options to reflect daylight saving mode but the user has to know when to use which one.
BTW, those of you who downloaded the indicator before 4:30 a.m., please re-download, i have changed some of the trading session hours according to this: Market Hours - Big Mike's Trading Forum
I wasnt online when i tested the indicator. Now, I am connected to zenfire, the x-axis keeps changing, it makes me feel dizzy :puke: , does anyone know how to make the plot_override to update only when it is FirstTickofBar?
OK, here just a small example, how to convert exchange time correctly to local time.
Let us assume that you want to convert Tokyo Market Hours to local time. This is not trivial, as a US based trader will switch to Summer Time in March and back to Standard Time in November.
Conversion is needed to correctly display the opening hours on your chart. This is cannot be done by using a fixed offset from GMT. Unlike .Net 2.0, which was used by NT 6.5., .Net 3.5. comes with a library allowing for time conversion. By the way this was prerequisite for the introduction of session templates.
(1) Find Time Zone for Tokyo
First declare a string variable and declare a variable of Type TimeZoneInfo
then affect correct time zone to TimeZoneInfo variable
(2) Retrieve the current session start and end times
You will need sessionEndTimeLocal, which holds the end of the current session in local time.
(3) Determine the Session Date
(4) Convert Opening Hours
Of course you need to declare the variables first. So let me summarize the process:
You first look at the end of your current session. This allows you to retrieve the session date (no trading session ever closes after midnight local time). You add the local opening hour to the session date, and you will now get the current opening time in Tokyo Standard Time. In a last step you convert Tokyo time to the local time zone of the NinjaTrader user.
Indicator works well. Your London start time is a bit late. Volume shows that the dealers are already at their desks around 7:00 GMT, because otherwise they miss the Asian-European overlap.
Another way to display the FOREX hours is just to use an appropriate session templates. The vertical lines indicate the opening of the London and New York markets. Nobody really cares, when the markets close.