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.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.