NexusFi: Find Your Edge


Home Menu

 





Forex Trading Hours


Discussion in Currencies

Updated
    1. trending_up 8,580 views
    2. thumb_up 27 thanks given
    3. group 2 followers
    1. forum 10 posts
    2. attach_file 5 attachments




 
Search this Thread
  #1 (permalink)
 
puppeye's Avatar
 puppeye 
hk
 
Experience: Beginner
Platform: ninjatrader
Posts: 56 since Aug 2009
Thanks Given: 89
Thanks Received: 446

Hi guys,

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.


Attached Files
Elite Membership required to download: ForexTradingHours_v01.zip
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
CFTC Rewrites the Rulebook -- Kalshi Cracks $1B Non-Spor …
Prediction Markets & Event Contracts
The Feds Stagflation Trap -- Negative Payrolls, $91 Oil, …
Traders Hideout
$24.5 Billion Record Month: Prediction Markets Shatter A …
Prediction Markets & Event Contracts
Wood Mackenzie Drops $200 Oil Forecast -- Airspace Expir …
Prediction Markets & Event Contracts
$500M Riding on World Cup 2026: France/Spain Co-Favored …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
21 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Hello Im new here
5 thanks
  #2 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,114


puppeye View Post
Hi guys,

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.

Attachment 31507

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.


Reply With Quote
Thanked by:
  #3 (permalink)
 
puppeye's Avatar
 puppeye 
hk
 
Experience: Beginner
Platform: ninjatrader
Posts: 56 since Aug 2009
Thanks Given: 89
Thanks Received: 446



Fat Tails View Post
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


Started this thread Reply With Quote
  #4 (permalink)
 
puppeye's Avatar
 puppeye 
hk
 
Experience: Beginner
Platform: ninjatrader
Posts: 56 since Aug 2009
Thanks Given: 89
Thanks Received: 446

I wasnt online when i tested the indicator. Now, I am connected to zenfire, the x-axis keeps changing, it makes me feel dizzy , does anyone know how to make the plot_override to update only when it is FirstTickofBar?


Started this thread Reply With Quote
  #5 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,114


puppeye View Post
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 can certainly help you with the DST issue, it is not really difficult to do.


Reply With Quote
Thanked by:
  #6 (permalink)
 
puppeye's Avatar
 puppeye 
hk
 
Experience: Beginner
Platform: ninjatrader
Posts: 56 since Aug 2009
Thanks Given: 89
Thanks Received: 446

this should fix the crazy time axis problem


Attached Files
Elite Membership required to download: ForexTradingHours_v01.zip
Started this thread Reply With Quote
Thanked by:
  #7 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,114

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
 
Code
private string tstName = "Tokyo Standard Time";
private TimeZoneInfo tstZone;
then affect correct time zone to TimeZoneInfo variable
 
Code
tstZone = TimeZoneInfo.FindSystemTimeZoneById(tstName);
(2) Retrieve the current session start and end times
 
Code
Bars.Session.GetNextBeginEnd(Time[0], out sessionStartTimeLocal, out sessionEndTimeLocal);
You will need sessionEndTimeLocal, which holds the end of the current session in local time.


(3) Determine the Session Date
 
Code
sessionDate = TimeZoneInfo.ConvertTime(sessionEndTimeLocal, TimeZoneInfo.Local, tstZone).Date;
(4) Convert Opening Hours
 
Code
xchange_start="9:00 AM";
xchange_end="6:00 PM";
xchange_start_Local = TimeZoneInfo.ConvertTime(sessionDate+xchange_start, tstZone, TimeZoneInfo.Local);
xchange_end_Local = TimeZoneInfo.ConvertTime(sessionDate+xchange_end, tstZone, TimeZoneInfo.Local);
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.

Not difficult at all.


Reply With Quote
Thanked by:
  #8 (permalink)
 
puppeye's Avatar
 puppeye 
hk
 
Experience: Beginner
Platform: ninjatrader
Posts: 56 since Aug 2009
Thanks Given: 89
Thanks Received: 446


Fat Tails View Post
Not difficult at all.

LOL

Thanks. I will certainly try that when i have time.


Started this thread Reply With Quote
Thanked by:
  #9 (permalink)
 
puppeye's Avatar
 puppeye 
hk
 
Experience: Beginner
Platform: ninjatrader
Posts: 56 since Aug 2009
Thanks Given: 89
Thanks Received: 446

So this one uses the TimeZoneInfo suggested by Fattails. It checks your local timezone and detect daylight saving automatically.

you can also define your own timezone by using UTC/GMT standards.

Added the following exchanges and fixed some serialized font/color problems:
  1. NewYork_StockExchange,
  2. NASDAQ,
  3. London_StockExchange,
  4. Toronto_StockExchange,
  5. Euronext_Paris,
  6. Frankfurt_StockExchange,
  7. Swiss_Exchange,
  8. NewZealand_StockMarket,
  9. Australian_SecuritiesExchange,
  10. Tokyo_StockExchange,
  11. HongKong_StockExchange,
  12. India_StockExchange,


Attached Files
Elite Membership required to download: ForexTradingHours_v03.zip
Started this thread Reply With Quote
  #10 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,114



puppeye View Post
So this one uses the TimeZoneInfo suggested by Fattails. It checks your local timezone and detect daylight saving automatically.

you can also define your own timezone by using UTC/GMT standards.

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.


Attached Thumbnails
Click image for larger version

Name:	6E 03-11 (5 Min) 22_02_2011.jpg
Views:	380
Size:	113.2 KB
ID:	31601  
Reply With Quote
Thanked by:




Last Updated on February 23, 2011


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts