OPEN-SOURCE SCRIPT
Updated Mansfield Long-Range Background

Mansfield Long-Range Background. From Stan Weinstein's book.
This plots the high-low range for the last N years, including the current year.
It gives us an idea of any long-term resistance or support in play, which may affect how a trend behaves.
Note that one could just as easily check the yearly chart to get what this is showing, but it's convenient to have a template with all the elements required to emulate a Mansfield chart.
This plots the high-low range for the last N years, including the current year.
It gives us an idea of any long-term resistance or support in play, which may affect how a trend behaves.
Note that one could just as easily check the yearly chart to get what this is showing, but it's convenient to have a template with all the elements required to emulate a Mansfield chart.
Release Notes
Bug fix: in our main weekly use case, Pine could not determine the no. of historical bars required.And thus this long-range indicator really is meant for weekly charts effectively, with around 10 years of data.
Release Notes
- Fix bug where we were missing bars in the weekly, and possibly showing things in reverse!
- Fix bug where there were fewer years than the lookback period configured, now it's min of lookback and available years.
- Explicitly error out if the indicator is on any non-weekly and non-yearly charts.
- Replace year labels with triangle-ups/downs, and a tooltip which shows the year, for visual compactness.
Release Notes
- Simplify code in parts
- Better logic for displaying year labels, with adjustable vertical spacing.
- Arrays only filled up to required lookback period at the most, now.
Release Notes
- Still some weird bug in yearly display, when it should be one to one with the candles.
- Remove use of yearly timeframes, simply sticking to the weekly timeframe, the main use case, where it works as expected.
Release Notes
Clarify Lookback Period title text to be more specific. Update chart!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.