🌐
Trading Strategy
tradingstrategy.ai › docs › _modules › pandas_ta › overlap › linreg.html
pandas_ta.overlap.linreg - Trading Strategy documentation
LINREG is a rolling regression of one variable. A Standard Linear Regression is between two or more variables. Source: TA Lib Calculation: Default Inputs: length=14 x = [1, 2, ..., n] x_sum = 0.5 * length * (length + 1) x2_sum = length * (length + 1) * (2 * length + 1) / 6 divisor = length ...
🌐
Libraries.io
libraries.io › pypi › pandas-ta-remake
pandas-ta-remake 1.0.4 on PyPI - Libraries.io - security & maintenance data for open source software
January 11, 2025 - Note: TA Lib must be installed to use all the Candlestick Patterns. pip install TA-Lib. If TA Lib is not installed, then only the builtin Candlestick Patterns will be available. ... Has 130+ indicators and utility functions. BETA Also Pandas TA will run TA Lib's version, this includes TA Lib's 63 Chart Patterns.
🌐
PyPI
pypi.org › project › pandas-ta
pandas-ta · PyPI
A popular and comprehensive Technical Analysis Library in Python 3 that leverages numba and numpy for accuracy and performance, and pandas for simplicity and bulk processing. The library contains more than 150 indicators and utilities as well ...
      » pip install pandas-ta
    
Published   Sep 14, 2025
Version   0.4.71b0
🌐
ProgramCreek
programcreek.com › python › example › 121344 › talib.LINEARREG
Python Examples of talib.LINEARREG
def LINEARREG(Series, timeperiod=14): res = talib.LINEARREG(Series.values, timeperiod) return pd.Series(res, index=Series.index) ... def test_linreg(self): result = pandas_ta.linreg(self.close) self.assertIsInstance(result, Series) self.assertEqual(result.name, 'LR_14') try: expected = tal.LINEARREG(self.close) pdt.assert_series_equal(result, expected, check_names=False) except AssertionError as ae: try: corr = pandas_ta.utils.df_error_analysis(result, expected, col=CORRELATION) self.assertGreater(corr, CORRELATION_THRESHOLD) except Exception as ex: error_analysis(result, CORRELATION, ex)
🌐
TradingView
tradingview.com › script › knItv1rm
pandas_ta — Library by blackcat1402
January 1, 2022 - Library "pandas_ta" Level: 3 Background Today is the first day of 2022 and happy new year every tradingviewers! May health and wealth go along with you all the time. I use this chance to publish my 1st PINE v5 lib : pandas_ta This is not a piece of cake like thing, which cost me a lot of time and efforts to build this lib.
🌐
YouTube
youtube.com › watch
Pandas TA Tutorial - YouTube
In this video, I introduce Pandas TA, yet another technical analysis library for Python. I discuss the projects we will build 1) a discord technical notifica...
Published   July 3, 2021
🌐
Pandas-ta
pandas-ta.dev
Pandas TA - Pandas TA
A popular and comprehensive Technical Analysis Library in Python 3 that leverages numba and numpy for accuracy and performance, and pandas for simplicity and bulk processing. The library contains more than 150 indicators and utilities as well as 60 Candlestick Patterns when TA Lib is installed ...
Top answer
1 of 3
2

I used talib to calculate the slope and intercept on the closing prices, then realised talib offers the full calc also. The result looks to be same as TradingView (just eyeballing).

Did the following in jupyterlab:

import pandas as pd
import numpy as np
import talib as tl
from pandas_datareader import data
%run "../../plt_setup.py"

asset = data.DataReader('^AXJO', 'yahoo', start='1/1/2015')

n = 270
(asset
 .assign(linreg = tl.LINEARREG(asset.Close, n))
 [['Close', 'linreg']]
 .dropna()
 .loc['2019-01-01':]
 .plot()
);

2 of 3
2

I was soaring with this question for a very long time, as a result I made such a function, it calculates linear regression as on the TradingView function ta.linreg() in PineScript:

import numpy as np

def np_shift(array: np.ndarray, offset: int = 1, fill_value=np.nan):
    result = np.empty_like(array)
    if offset > 0:
        result[:offset] = fill_value
        result[offset:] = array[:-offset]
    elif offset < 0:
        result[offset:] = fill_value
        result[:offset] = array[-offset:]
    else:
        result[:] = array
    return result

def Linreg(source: np.ndarray, length: int, offset: int = 0):
    size = len(source)
    linear = np.zeros(size)

    for i in range(length, size):

        sumX = 0.0
        sumY = 0.0
        sumXSqr = 0.0
        sumXY = 0.0

        for z in range(length):
            val = source[i-z]
            per = z + 1.0
            sumX += per
            sumY += val
            sumXSqr += per * per
            sumXY += val * per

        slope = (length * sumXY - sumX * sumY) / (length * sumXSqr - sumX * sumX)
        average = sumY / length
        intercept = average - slope * sumX / length + slope

        linear[i] = intercept

    if offset != 0:
        linear = np_shift(linear, offset)

    return linear
Find elsewhere
🌐
GitHub
github.com › Laezerus › Pandas-TA
GitHub - Laezerus/Pandas-TA: Technical Analysis Indicators - Pandas TA is an easy to use Python 3 Pandas Extension with 130+ Indicators · GitHub
Klinger Volume Oscillator (kvo): ... Linear Regression (linreg): Checks numpy's version to determine whether to utilize the as_strided method or the newer sliding_window_view method....
Author   Laezerus
🌐
GitHub
github.com › 0xAVX › pandas-ta
GitHub - 0xAVX/pandas-ta: Technical Analysis Indicators - Pandas TA is an easy to use Python 3 Pandas Extension with 150+ Indicators
Klinger Volume Oscillator (kvo): ... Linear Regression (linreg): Checks numpy's version to determine whether to utilize the as_strided method or the newer sliding_window_view method....
Author   0xAVX
🌐
GitHub
github.com › aarigs › pandas-ta
GitHub - aarigs/pandas-ta: An easy to use Python 3 Pandas Extension with 70+Technical Analysis Indicators · GitHub
Technical Analysis (TA) is an easy to use library that is built upon Python's Pandas library with more than 60 Indicators. These indicators are comminly used for financial time series datasets with columns or labels similar to: datetime, open, ...
Starred by 114 users
Forked by 1.3K users
Languages   Python
🌐
GitHub
gist.github.com › textarcana › 0ce44f4011122a4e433bb8d936a3a943
pandas_ta full list of technical indicators as of 2024 · GitHub
A wrapper for ta.linreg(series, r=True) Directional Movement: dm · Efficiency Ratio: er · Elder Ray Index: eri · Fisher Transform: fisher · Inertia: inertia · KDJ: kdj · KST Oscillator: kst · Moving Average Convergence Divergence: macd · Momentum: mom ·
🌐
GitHub
github.com › xgboosted › pandas-ta-classic › releases
Releases · xgboosted/pandas-ta-classic
March 17, 2026 - View all tags · 0.4.47 Latest · Latest · fix: dependency cleanup, pandas 3.0 compat, and Windows pool fix by @rmarcink in #79 · fix: resolve initialization and edge-case bugs across 11 indicators by @rmarcink in #80 · fix: correct numerical bugs in linreg, TSI, brar, bbands, cti by @rmarcink in #94 ·
Author   xgboosted
🌐
Lightrun
lightrun.com › answers › twopirllc-pandas-ta-results-of-linreg-does-not-match-taliblinearreg
Results of linreg does not match talib.LINEARREG()
Debug Daily provides real-world solutions to common developer problems. Find answers to GitHub Actions errors, React Native issues, Python bugs, and more. Sponsored by Lightrun.
🌐
Anaconda.org
anaconda.org › conda-forge › pandas-ta
pandas-ta - conda-forge | Anaconda.org
Pandas Technical Analysis (Pandas TA) is an easy to use library that leverages the Pandas package with more than 130 Indicators and Utility functions and more than 60 TA Lib Candlestick Patterns.
🌐
GitHub
github.com › Data-Analisis › Technical-Analysis-Indicators---Pandas
GitHub - Data-Analisis/Technical-Analysis-Indicators---Pandas: Technical Analysis Indicators - Pandas TA is an easy to use Python 3 Pandas Extension with 130+ Indicators · GitHub
Technical Analysis Indicators - Pandas TA is an easy to use Python 3 Pandas Extension with 130+ Indicators - Data-Analisis/Technical-Analysis-Indicators---Pandas
Starred by 155 users
Forked by 47 users
Languages   Python 99.9% | Makefile 0.1%
🌐
Kaggle
kaggle.com › datasets › celiker › pandasta
Pandas TA | TA-Lib
Checking your browser before accessing www.kaggle.com · Click here if you are not automatically redirected after 5 seconds