OPEN-SOURCE SCRIPT
LSMAs

This indicator calculates and plots two Least Squares Moving Averages (LSMA) based on different lengths and a Smoothed Moving Average (SMMA) of the longer LSMA.
Inputs
lengthA : Period length for the first, longer LSMA.
lengthB : Period length for the second, shorter LSMA.
signAl : Signal period used in SMMA smoothing.
Calculations
LSMA-A and LSMA-B : Calculates the linear regression (least squares) of source over lengthA and lengthB respectively, with no offset. These represent two LSMAs, one slow and one fast.
SMMA : This is a smoothed moving average of the longer LSMA (LSMA-A).
Purpose
This indicator helps traders identify trend directions and momentum by using two least squares regression lines of different lengths to capture short- and long-term trends in price. The SMMA smoothing of the longer LSMA may be used as a signal or confirmation line to reduce noise and produce smoother signals.
It generates buy and sell signals based on the intersection of the LSMA-A and SMMA. If the LSMA-A crosses the SMMA upwards, a BUY signal is generated; if it crosses the SMMA downwards, a SELL signal is generated.
The LSMA-B, which is short-term, can be used for wave analysis. When a peak forms, a high is observed on the chart, and when a valley forms, a low is observed. This allows us to determine whether the wave is rising or falling.
Summary
Two LSMAs are calculated: one slow (lengthA), one fast (lengthB).
A smoothed moving average (SMMA) of the slow LSMA is computed using the signal length (signAl).
All three curves are overlaid on the price chart for visual trend and momentum analysis.
Inputs
lengthA : Period length for the first, longer LSMA.
lengthB : Period length for the second, shorter LSMA.
signAl : Signal period used in SMMA smoothing.
Calculations
LSMA-A and LSMA-B : Calculates the linear regression (least squares) of source over lengthA and lengthB respectively, with no offset. These represent two LSMAs, one slow and one fast.
SMMA : This is a smoothed moving average of the longer LSMA (LSMA-A).
Purpose
This indicator helps traders identify trend directions and momentum by using two least squares regression lines of different lengths to capture short- and long-term trends in price. The SMMA smoothing of the longer LSMA may be used as a signal or confirmation line to reduce noise and produce smoother signals.
It generates buy and sell signals based on the intersection of the LSMA-A and SMMA. If the LSMA-A crosses the SMMA upwards, a BUY signal is generated; if it crosses the SMMA downwards, a SELL signal is generated.
The LSMA-B, which is short-term, can be used for wave analysis. When a peak forms, a high is observed on the chart, and when a valley forms, a low is observed. This allows us to determine whether the wave is rising or falling.
Summary
Two LSMAs are calculated: one slow (lengthA), one fast (lengthB).
A smoothed moving average (SMMA) of the slow LSMA is computed using the signal length (signAl).
All three curves are overlaid on the price chart for visual trend and momentum analysis.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。