Least Squares Moving Average

Definition

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.

Calculations

Pine Script
//@version=4
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)
plot(lsma)

Summary

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.

首頁 股票篩選器 外匯篩選器 加密貨幣篩選器 全球財經日曆 如何運作 圖表功能 價格 推薦朋友 網站規則 幫助中心 網站 & 經紀商解決方案 小工具 圖表解決方案 輕量圖表庫 部落格 & 新聞 推特
概覽 個人資料設定 賬戶和賬單 推薦朋友 代幣 我的客服工單 幫助中心 發表的想法 粉絲 正在關注 私人訊息 在線聊天 登出