Least Squares Moving Average


Least Squares Moving Average is a curve showing linear regression calculations. On each bar, the indicator displays a linear regression based on the prices for a period that is specified by the Length value in settings.


Pine Script
study(title = "Least Squares Moving Average", shorttitle="LSMA", overlay=true, resolution="")
length = input(title="Length", type=input.integer, defval=25)
offset = input(title="Offset", type=input.integer, defval=0)
src = input(close, title="Source")
lsma = linreg(src, length, offset)


The Least Squares Moving Average can be used as a trend indicator and reversal indicator. It is used as an alternative to other traditional indicators like the moving average or exponential moving average. The Least Squares Moving Average has a different calculation than both of those moving averages. The indicator displays a linear regression based on the prices for a specific period of time. This period of time can be defined in the indicator settings.

Beranda Penyaring Saham Penyaring Forex Penyaring Crypto Kalender Ekonomi Tentang Fitur-Fitur Chart Harga Akun Refer seorang teman Tata Tertib Pusat Bantuan Solusi Website & Broker Widget-Widget Solusi Charting Perpustakaan Charting Ringan Blog & Berita Twitter