OPEN-SOURCE SCRIPT
Updated Example - HTF Values Without 'Security()'

This is an example of how to reference higher timeframe data without the
need for a 'security()' call.
I have attempted to create the function example:
with the purpose of wrapping up and pumping out all common relevent HTF
price data that's needed for your everyday indicators in a reliable fashion.
need for a 'security()' call.
I have attempted to create the function example:
Pine Script®
f_insecurity()
with the purpose of wrapping up and pumping out all common relevent HTF
price data that's needed for your everyday indicators in a reliable fashion.
Release Notes
- Updated to remove potential repainting confusion with:Pine Script®security()
- Added ability to toggle the security() comparison overlay on and off.
..apologies for any confusion regarding the previous repainting option, it was intended for debugging purposes only at the time of writing.
Cheers - Jay.
Release Notes
- Cleaned up self-referencing ternary operations - there was no need to reference 'previous' values of self, just 'active' self.
- Added 'nz()' conversion checks where they might be necessary.
- Removed redundant bar-counting mechanic.
- Cleaned up some of the code comments.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.