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 อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน