OPEN-SOURCE SCRIPT

Scaled Historical ATR [SS]

업데이트됨
Hello again everyone,

This is the Scaled ATR Range indicator. This was done in response to an article/analysis I posted regarding the expected high and range on SPX. I would encourage you to read it here:

SPY/SPX: Top's probably not in.


Essentially, I took SPX data, scaled it to correct for inflation, then calculated the ATR for Bullish years to get our average range to expect and our close range to expected.

I accomplished this analysis using Excel; however, I figured Pinescript would handle this type of task more elegantly, and I was correct!
This indicator is the result.

What it does:

This indicator permits the analyst to select a historic period in time. The indicator will then scale the period into returns and convert the range to a corrected range based on the current position of the ticker. How it does this is by converting the returns of the historic period selected, then multiplying the returns by the current period open, to ensure that the range amounts are corrected for inflation and natural growth of a ticker.

I say analyst because this indicator is intended to be used by both professional and recreational analysts, to give them an easy way to:

a) Scale historic data and correct it based on the current rate; and
b) Offer insight into a ticker’s ATR and behaviour during bullish and bearish periods.

Prior to this indicator, the only way to do this would be manually or the use of statistical software.

How to use?

The indicator’s use is quite simple. Once launched, the indicator will ask the user to input a timeframe period that the user is interested in assessing. In the main chart above, I chose SPX between 1995 and 2001.

The user can further filter down the data using the settings menu. In the settings menu, there is an option to filter by “All”, “Bullish Periods” or “Bearish Periods”.

Filtering by “All”

Filtering by “All” will include all candles selected within the timeframe. This includes both bearish and bullish candles. It will give you the averaged out range for the entire period of time, including both bearish and bullish instances.

Filtering by “Bullish”

Filtering by “Bullish” will omit any red candles from the analysis. It will only return the ATR ranges for green, bullish candles.

Filtering by “Bearish”

Inverse to filtering by Bullish, if you filter by Bearish, it will only include the red, bearish candles in the analysis.

스냅샷

My suggestion? If you are trying to determine t he likely outcome of a bullish year, filter by Bullish instances. If you want the likely outcome of a bearish year, filter by Bearish.

Other features of the Indicator:

The indicator will display the current period statistics. In the main chart above, you can see that the current ranges for this year are displayed. This allows you to do a side by side comparison of the current period vs. the historic period you are looking at. This can alert you to further upside, further downside and the anticipated close range. It can also alert you to whether or not we are following a similar trajectory as the historical periods you are looking at.
As well, the indicator will list target prices for the current period based on the historical periods you are looking at. This helps to put things into perspective.

Concluding Remarks

And that is the indicator in a nutshell! I encourage you to read the article I linked above to see how you may use it in an analysis. This would be the best example of a real world application of this indicator!

Otherwise, I hope you enjoy and, as always, safe trades!
릴리즈 노트
Added Max variables to see the max high range and max low range as well as the associated theoretical target price.
statistics

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?


For real-time updates and premium indicators, consider joining my group at: patreon.com/steversteves
또한 다음에서도:

면책사항