mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-19 19:18:05 +00:00
doc headers
This commit is contained in:
@@ -1,5 +1,22 @@
|
||||
# LSMA: Least Squares Moving Average
|
||||
|
||||
| Property | Value |
|
||||
| ---------------- | -------------------------------- |
|
||||
| **Category** | Trend (FIR MA) |
|
||||
| **Inputs** | Source (close) |
|
||||
| **Parameters** | `period`, `offset` (default 0) |
|
||||
| **Outputs** | Single series (Lsma) |
|
||||
| **Output range** | Tracks input |
|
||||
| **Warmup** | `period` bars |
|
||||
|
||||
### TL;DR
|
||||
|
||||
- LSMA (Least Squares Moving Average), also known as the Moving Linear Regression or Endpoint Moving Average, calculates the least squares regression...
|
||||
- Parameterized by `period`, `offset` (default 0).
|
||||
- Output range: Tracks input.
|
||||
- Requires `period` bars of warmup before first valid output (IsHot = true).
|
||||
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
|
||||
|
||||
> "If you want to know where the price is going, draw a line through where it's been. LSMA does this for every single bar, tirelessly fitting linear regressions while you sleep."
|
||||
|
||||
LSMA (Least Squares Moving Average), also known as the Moving Linear Regression or Endpoint Moving Average, calculates the least squares regression line for the preceding time periods. In plain English: it finds the "best fit" line for the data window and tells you where that line ends.
|
||||
@@ -227,4 +244,4 @@ private double GetValidValue(double input)
|
||||
|
||||
1. **Overshoot**: Because it projects a trend, LSMA will overshoot significantly when the trend reverses. It assumes the trend continues.
|
||||
2. **Offset**: You can use a positive offset to extrapolate into the future (forecasting), or a negative offset to center the average.
|
||||
3. **Noise**: It is very sensitive to outliers because it tries to fit a line to them.
|
||||
3. **Noise**: It is very sensitive to outliers because it tries to fit a line to them.
|
||||
|
||||
Reference in New Issue
Block a user