OPEN-SOURCE SCRIPT

Extended Recursive Bands - Maximum Efficiency With Extra Options

Introducing A New Calculation For Efficient Bands Calculation !

Here it is ! The Recursive Bands Indicator, an indicator specially created to be extremely efficient, i think you already know that calculation time is extra important in algorithmic trading, and this is the principal motivation for the creation of the proposed indicator. Originally described in my paper "Pierrefeu, Alex (2019): Recursive Bands - A New Indicator For Technical Analysis", the indicator framework has been widely used in my previous uploaded indicators, however it would have been a shame to not upload it, however user experience being a major concern for me, i decided to add extra options, which explain the term "extended".

On The Indicator Calculation

You can skip this part if it doesn't interest you. The calculation of the indicator is based on recursion, but i want to explain the mathematical formula described in the paper.

스냅샷

I've seen some users trying to remake it from the calculations, however there was always something weird, and i understand, mathematical notations are always a bit weird, even myself don't always write them correctly/understand them, however this one is relatively simple to understand.

First lets explain each elements of the calculation :

α = smoothing constant, or 2/(length+1)

max/min = maximum and minimum function, max return the greatest input value while min return the lowest one, for example :

max(4,2) = 4 while min(4,2) = 2

the "||" notation mean taking the absolute value, for example : |-1| = abs(-1) = 1

The calculation after the max/min function is called the correction factor, and is the core of the indicator. The last two variables are just here to provide an initial value for upper and lower, basically when we start our calculations we will assign the value of the closing price for upper and lower.

The motivation behind using a smoothing constant in range of (0,1) was to tell the reader that the indicator is easily made adaptive, this is what i did on my adaptive trailing stop indicator by using the efficiency ratio as smoothing variable, the user can use 1/length instead of the provided calculation for alpha.

If you interested on the indicator main logic, it is actually really simple, by using upper = max(price,upper) and lower = min(price,lower) we would get the maximum/minimum price value at time t, therefore upper can only be greater or equal than its precedent value, while lower can only be lower or equal than its precedent value, in order to fix that we subtract/sum upper/lower with a value, this allow the upper band to be lower than its precedent value and lower to be greater than its precedent value, this is the role of the correction factor.

The Indicator

The indicator display one upper and one lower band, every common usages applied to bands indicators such as support/resistance, breakout, trailing stop...etc, can also be applied to this one. length control how reactive the bands are, higher values of length will make the bands cross the price less often.

In order to provide more flexibility for the user i added the option to use various methods for the calculation of the indicator, therefore the indicator can use the average true range, standard deviation, average high-low range, and one totally exclusive method specially designed for this indicator.

Classic Method

This option make the indicator use its classical calculation, this is the most efficient method of all.

스냅샷

Atr Method (atr)

This method use the average true range as correction factor, notice that lower values of length can still produce wide band.

스냅샷

Standard Deviation Method (stdev)

This method use a biased estimate of the standard deviation as correction factor.

스냅샷

The method produce smoother bands that converge more slowly toward the price in comparison with the classic correction factor.

Average High-Low Range Method (ahlr)

This method use the average of the high-low range as correction factor, extremely similar to the average true range.

스냅샷

Rising Falling Volatility (rfv) Method

A new method created for this indicator, this correction factor use the absolute prices changes when price value is greater/lower than any length past values of the price, this allow to have more boxy shaped bands, work best with greater values of length.

스냅샷

The bands can be in contact with this method, a possible fix in the future.

Conclusion

The recursive band indicator is one of my greatest indicators in my opinion (i would love to have yours), as you can see the idea behind it is extremely simple and allow for a super efficient band indicator, which was the original motivation behind it, in order to provide more fun for the users i also added more option for the correction factor, this allow the user to be creative and not get stuck with the original calculation.

Like the trend step indicator family we have almost ended our series on the recursive band framework, 1 more trailing stop will be added in the future, and then we'll have more "boring" stuff until i find something cool again, it shouldn't be long ;)

Thanks for reading !



bandsbreakoutefficientEnvelope (ENV)recursivetrendTrend AnalysisVolatility

오픈 소스 스크립트

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

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


Check out the indicators we are making at luxalgo: tradingview.com/u/LuxAlgo/
또한 다음에서도:

면책사항