Linear Regression Intercept
Linear regression Intercept indicates the value of the price when the value of the time series is 0.
Method
Section titled “Method”tm.ta.linearreg_intercept(source, timeperiod)Inputs
Section titled “Inputs”| Parameter | Argument type | Description | Default Value |
|---|---|---|---|
| source | pd.Series | Input data series | - |
| timeperiod | int | Number of periods for the indicator | 14 |
Outputs
Section titled “Outputs”| Output | Type |
|---|---|
| linearreg_intercept | np.ndarray |
Example usage
Section titled “Example usage”import tradomate as tm
@tm.strategy()def my_strategy(config: tm.TradomateConfig, data: tm.TradomateData):
# Trying out linearreg_intercept = tm.ta.linearreg_intercept(data.close, timeperiod=14)
# Get the last value and print last_value = linearreg_intercept.iloc[-1] tm.log(f"Last value of is {last_value}")
# Plot the values of linearreg_intercept tm.plot(linearreg_intercept, title="", overlay=False)