Linear Regression — Tradetron Community
← Community

Linear Regression

Uncategorized 1,629 views

Bhavesh Savla

Dear Team,
I want to create strategy using Linear Regression functions. But not able to find more details about it. The link provided in documentation i.e. https://www.ta-lib.org/function.html - is not working.
Anyone using any of the Linear Regression methods (Slope, Angle, Intercept)??
Also, want to know, how is slope / angle calculated? It’ll be really helpful if explained neatly using charts.
Thanking you well in advance for any such help in this direction.
Thanks & Regards,
Bhavesh Savla

mano00

@Nelson please try to help on this regard.
Thanks in advance

Tradetron Team Tradetron team

Tradetron has four linear regression keywords (period = number of candles):

  • LINEARREG: value of the regression line at each candle.
  • LINEARREG SLOPE: slope of that line (price change per candle). Positive = up trend.
  • LINEARREG_ANGLE: the same slope as an angle in degrees.
  • LINEARREG_INTERCEPT: where the line starts.

Example: Position(LINEARREG SLOPE(CLOSE(Symbol(<inst>, '5m')), 14), -1) > Number(0)

How to read them

  • Slope above 0 and rising: the trend is getting stronger upward. Below 0: downward.
  • The angle is the same information in degrees, so pick one of the two, not both.
  • Compare price with LINEARREG to see if it is above or below the fitted line.
  • A longer period gives a smoother, slower line.

These follow the standard TA-Lib definitions. Check the values against your chart in Live Offline before trading on them.

Keyword reference: Keyword Documentation — Tradetron

:sparkles: Answer written with AI from Tradetron docs (Oct 2026). Original replies are kept above. Spot something wrong? Reply below.