FX Sessions & Killzones ET

skullp 已更新   
Just another sessions indicator. Among all the many existing ones, I didn't find anything simple that would cover my needs and that would actually be correct.
New York time is forced here for plotting the stripes so you don't need to worry about the time zone currently set on your chart. The indicator will be accurate during Daylight Saving Time (which, in 2023 for example, started on Sunday, 12 March , 02:00:00 and will be in effect until Sunday, 5 November, 02:00:00).
UPDATE: Fixed the Asian Open Killzone.
Asian range added.
UPDATE: Added ICT Silver Bullet (range from 10:00 AM – 11:00 AM)
UPDATE: Added the option to add / define one custom session (not displayed by default).
When you like to be precise, as I do, you may find yourself frustrated with the level of inconsistency on this topic on the Internet.
I did my best to double check the relevant sources again, reconsile the time zones and get it right. Hence the necessaity of the update.

Release notes:
Start of Sydney session corrected.
Asian session added / split from Tokyo as they are technically not exactly the same thing.
Tokyo session corrected.
End of London (and Frankfurt) session(s) corrected.
End of New York session corrected.
London open killzone shifted backward.
London close killzone shifted forward.
New York open killzone extended backward.
Equities range (and equities closing / power hour) added for those who trade ES, NQ, etc.

Plus I have adjusted the default settings as I presume that most people would generally only want the Asian range and killzones.

Note: If you're wondering why ICT killzones generally start one hour earlier than the starts of the official FX sessions, then I guess that it's just extended to account for pre-market trading.

Here's an overview of the hours:

• Sydney Session = 5:00 PM – 2:00 AM EDT = 9:00 PM – 6:00 AM UTC
• Asian Session = 7:00 PM – 4:00 AM EDT = 11:00 PM – 08:00 AM UTC
• Tokyo Session = 8:00 PM – 5:00 AM EDT = 12:00 AM – 9:00 AM UTC
• Frankfurt Session = 2:00 AM – 11:00 PM EDT = 6:00 AM – 3:00 PM UTC
• London Session = 3:00 AM – 12:00 PM EDT = 7:00 AM – 4:00 PM UTC
• New York / North American Session = 8:00 AM – 5:00 PM EDT = 1:00 PM – 10:00 PM UTC
• ICT Asian Open Killzone = 7:00 PM – 9:00 AM EDT
• ICT Asian Range = 7:00 PM – 12:00 AM EDT
• ICT London Open Killzone = 2:00 AM – 5:00 AM EDT
• ICT London Close Killzone = 10:00 AM – 12:00 PM EDT
• ICT New York Open Killzone = 7:00 AM – 10:00 AM EDT
• Equities = 9:30 AM – 4:00 PM EDT
• Equities Closing / Power Hour = 3:00 PM – 4:00 PM EDT
Complete overhaul for better user experience.
Start and end of all sessions now fully customizable.
Numbers removed from status line, cleaned up.
Sydney weekdays corrected.
Colors now a bit more distinct for better visibility on Mobiles.
Now includes all 3 time windows for the Silver Bullet setup.
An unobtrusive message will now appear on higher time frames (starting from the 2h) that "Some of the sessions may require lower time frames to appear."
I've done this primarily for myself but hopefully it can serve others as well.
I noticed the script was not resetting to default values. Now fixed.
A couple more adjustments to the colors so that it's better visible in light mode as well.
I've added an option to set a custom session box showing the high and low of the given sesssion which can be useful for certain strategies.

And one more note: The time zone is hard set to New York which means that the start and end time of the sessions should actually be correct throughout the whole year, not just during summer / daylight saving time.
The time shift between New York and Australia is different in winter, (more specifically, the time difference between New York and Sydney is usually 15 hours during standard time and 14 hours during daylight saving time). I have now adjusted the start and end times of the Sydney and Asian sessions so they are relevant to the current Fall/Winter time. The name of the indicator still says 'Spring/Summer', because changing the title would require dragging this through TradingView dev team, but feel free to use it during winter, the time windows are now correct. Besides, they are adjustable anyway.
Also, I have merged Asian and Tokyo sessions for the sake of simplification.
More importantly, I have added the option to plot a horizontal line which will – by default – be drawn from New York midnight open, but you can adjust the time of the starting point if you so wish. (Note that the time you set in the settings must align with the open of some candle currently displayed on the chart, which means that it will not work on all time frames. Whole hours – such as the default New York midnight open – will work on the 1-hour and below, down to the 1-minute.)
In addition, I have added the option to display session / daily breaks based on New York time - those are different from the 'stock' session breaks offered by TradingView settings as the 'stock' ones are based on the exchange time zone.
I hate to make it more complex, but as the article on Babypips puts it, 'dealing with Daylight Saving Time is a pain…', and I couldn't agree more. I have now added the option to adjust the start and end times of the sessions to EDT .
You don't need to worry about the New York session alone or anything that's directly associated with it, as this script specifically uses the "America/New_York" timezone. This means it will adjust itself and will remain correct regardless of whether it's currently Daylight Saving Time in New York or not. However, for other sessions and countries, the shift turns out to be different depending on Standard Time vs Daylight Time.
Pine Script doesn't allow variables to be used as default values. As a workaround, I simply added one more set of default values called 'EDT Adjustment' wherever applicable. In an attempt to make it as simple as possible, I have implemented a global switch (at the very top of the settings). All you need to do is turn it on during Daylight Time or turn it off during Standard Time . I've set it to be on by default as we've just entered the Daylight Time period. Other than that, you don't need to worry about the start and end times as the default values are, or should already be, correct. You may notice that, for some of the sessions, the days of the week had to be adjusted as well. Again, the New York session-related settings are taken care of automatically, so you won't find that addition in those sections.
At the same time, I wanted to keep the option to customize any value however you see fit.
I acknowledge that this will, unfortunately, never be perfect, as different countries switch to Daylight Time at different times. There may be cross periods when the start and end times will not perfectly match. This is about as close to overall correctness as I could get, but I would still suggest that you do your due diligence, especially during spring and fall, if you're trading anything outside the New York session.
Again, I'm doing this primarily for myself, but if you find it useful, all the better.
Added an option to increase performance by restricting the number of bars used in calculations. Users can enable this feature by ticking the box under the 'Limit Script Calculation...' section and specifying the desired number of bars in the 'Number of Bars to Fill on Chart' input field.

Added the New York / US Lunch Hour (12:00 PM to 1:00 PM ET) as a predefined session option. Users can now easily analyze price action during this specific time period.

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。