LinRegIntercept

forge.taclassSince Forge API 1
Signaturepython
forge.ta.LinRegIntercept(**inputs: Any) -> None

Where the fitted line starts, at the oldest bar of the window.

Inputs

NameTypeDefaultRange
sourcesourceclose
periodint142 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