OPEN-SOURCE SCRIPT

Volume weighted LSMA

Quick script made by reusing some functions written for other projects. This is a variation on the least squares moving average, but with custom weights on the linear regression. This gives higher weights to recent values and values with high volume.

Behaves very similarly to my volume weighted Hull moving average, especially with the hull smoothing option turned on.
leastsquaresLeast Squares Moving Average (LSMA)Moving Averages

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 publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer