Adaptive Least Squares

An adaptive filtering technique allowing permanent re-evaluation of the filter parameters according to price volatility . The construction of this filter is based on the formula of moving ordinary least squares or lsma, the period parameter is estimated by dividing the true range with its highest. The filter will react faster during high volatility periods and slower during low volatility ones.

High smooth parameter will create smoother results, values inferior to 3 are recommended.

You can easily replace the parameter estimation method as long as the one used fluctuate in a range of , for example you can use the efficiency ratio

ER = abs(change(close,length))/sum(abs(change(close)),length)

Or the Fractal Dimension Index , in fact any values will work as long as they are rescaled ( stoch (value,value,value,length)/100)

For any suggestions/questions feel free to send me a message :)

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?

Become a Patreon and get access to exclusive technical indicators!

You can also check out some of the indicators I made for luxalgo :


Nice one!
+1 Reply
alexgrover spinte7
@spinte7, my pleasure :)
So if I'm correct this indicator uses stochastic?

Am I right?
Is it supposed to be (2 / alpha) + 1 or 2 / (alpha + 1)?