LinRegIntercept
forge.taclassSince Forge API 1
Signaturepython
forge.ta.LinRegIntercept(**inputs: Any) -> NoneWhere the fitted line starts, at the oldest bar of the window.
Inputs
| Name | Type | Default | Range |
|---|---|---|---|
| source | source | close | |
| period | int | 14 | 2 to 5000 |
Indicator: Linear regression intercept
Fit a straight line by least squares to the last period values, with t = 0 at the oldest.
b = (period * sum(t*y) - sum(t) * sum(y)) / (period * sum(t^2) - sum(t)^2)
a = (sum(y) - b * sum(t)) / period
Intercept = a