NexusFi: Find Your Edge


Home Menu

 





Forex Trading Hours


Discussion in Currencies

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




 
Search this Thread

Forex Trading Hours

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

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?
ZombieSqueeze
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
MC PL editor upgrade
MultiCharts
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
HumbleTraders next chapter
11 thanks
GFIs1 1 DAX trade per day journal
11 thanks
  #2 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


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: 445



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: 445

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?

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


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: 445

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, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102

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: 445


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: 445

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, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



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:	278
Size:	113.2 KB
ID:	31601  
Reply With Quote
Thanked by:




Last Updated on February 23, 2011


© 2024 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 - Privacy Policy - Downloads - Top
no new posts