ZenAndTheArtOfTrading

Trading Session Indicator

This indicator is basically just a back-testing tool. All it does is highlight the background of your charts with the specified color within the specified timezone.

This is useful particularly for back-testing purposes, such as testing a day-trading strategy within a particular period of the day or ignoring signals that fall within the given timeframe (which is useful for ignoring setups during your testing that appear while you're asleep or at work etc.)

Take it easy :)
- Matt.
Release Notes: Minor improvements
Release Notes: Added alert functionality
Release Notes: Added "end of session" alert functionality
Release Notes: Fixed end of session alert
Release Notes: Updated alert functionality
Release Notes: Added ability to hide background color on a separate timeframe
Release Notes: Added an option to hide this indicator on the 4HR timeframe, Daily, Weekly and Monthly
Release Notes: -
- Converted to Pine Script v4
Release Notes: A few minor changes & improvements
Release Notes: Fixed the script not working on weekends
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?
If you want to master Pine Script coding, watch my free YouTube lessons or get the source code to my scripts then check out my Pine Script Mastery Course website: https://www.pinescriptmastery.com

Kommentarer

Hey nice indicator, Im using this for trading cfd, since cfd runs 24hrs and the actual market only opens in the day. Im setting the time to highlight the actual day opening hours but its not using my local time i set in tradingview, is there a quick fix for this?
+2 Svara
@traderbyday, Oh man, I wish there was! I have the same problem on all my scripts. I'm not aware of a quick fix unfortunately. It might be worth sending the TradingView support team a ticket if it's really bothering you, they have fixed a number of things on the platform like that when I've sent them requests. Good luck with your trading brother :) Sorry I couldn't be of more help.
Svara
Thanks for this its going to help my back-testing enormously!
+1 Svara
ZenAndTheArtOfTrading Samir_The_Trader
@Samir_The_Trader, You're welcome man, good luck with your testing!
Svara
Hey - This is nice simple script. But I also need it on saturday and sunday.
How can I change it?
Svara
@Q600, Hi Q600! So sorry for the late reply, I must have missed your comment somehow. The script is now fixed to work on weekends if you still require it :)
Svara
This is awesome. You pretty much nailed all the features one could think of. The weird thing is that if I set it too wide then I get a an internal server study error. As soon as I change a setting in the settings menu, it comes right up, no problem. Not sure how to resolve the initial server study error though.
Svara
kurtsmock kurtsmock
@kurtsmock, I think I figured it... my mistake
Svara
Script not working properly. It zooms out wayyy to much when I add the script.
Svara
@NoahKhan, Not sure what you mean, it appears to be working fine on my end:

Can you please send me a screenshot example? It should not affect your chart zoom at all unless it's some kind of TradingView bug
Svara
Hem Aktie-screener Forex-screener Krypto-screener Ekonomisk kalender Om Diagramfunktioner Priser Tipsa en vän Ordningsregler Hjälpcenter Webbsidor och mäklarlösningar Widgets Diagramlösningar Lightweight Charting Library Blogg och nyheter Twitter