CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-ta-lib

Python wrapper for TA-LIB providing 175+ technical analysis indicators for financial market data

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

overlap-studies.mddocs/

Overlap Studies

Trend-following indicators and moving averages that smooth price data to identify trends and provide support/resistance levels. These indicators "overlay" on price charts and help traders identify trend direction and potential reversal points.

Capabilities

Simple Moving Average

Calculates the arithmetic mean of prices over a specified time period, providing trend direction and support/resistance levels.

def SMA(real, timeperiod=30):
    """
    Simple Moving Average
    
    Parameters:
    - real: array-like, input price data (typically close prices)
    - timeperiod: int, number of periods for averaging (default: 30)
    
    Returns:
    numpy.ndarray: SMA values
    """

Exponential Moving Average

Calculates exponentially weighted moving average giving more weight to recent prices, making it more responsive to price changes than SMA.

def EMA(real, timeperiod=30):
    """
    Exponential Moving Average
    
    Parameters:
    - real: array-like, input price data
    - timeperiod: int, number of periods (default: 30)
    
    Returns:
    numpy.ndarray: EMA values
    """

Bollinger Bands

Creates volatility bands around a moving average to identify overbought/oversold conditions and potential breakouts.

def BBANDS(real, timeperiod=5, nbdevup=2, nbdevdn=2, matype=MA_Type.SMA):
    """
    Bollinger Bands
    
    Parameters:
    - real: array-like, input price data
    - timeperiod: int, moving average period (default: 5)
    - nbdevup: float, upper band deviation multiplier (default: 2)
    - nbdevdn: float, lower band deviation multiplier (default: 2)  
    - matype: MA_Type, moving average type (default: SMA)
    
    Returns:
    tuple: (upper_band, middle_band, lower_band)
    """

Double Exponential Moving Average

Double-smoothed exponential moving average that reduces lag while maintaining smoothness.

def DEMA(real, timeperiod=30):
    """
    Double Exponential Moving Average
    
    Parameters:
    - real: array-like, input price data
    - timeperiod: int, number of periods (default: 30)
    
    Returns:
    numpy.ndarray: DEMA values
    """

Triple Exponential Moving Average

Triple-smoothed exponential moving average providing even less lag than DEMA.

def TEMA(real, timeperiod=30):
    """
    Triple Exponential Moving Average
    
    Parameters:
    - real: array-like, input price data
    - timeperiod: int, number of periods (default: 30)
    
    Returns:
    numpy.ndarray: TEMA values
    """

Triangular Moving Average

Double-smoothed simple moving average creating a triangular weighting pattern.

def TRIMA(real, timeperiod=30):
    """
    Triangular Moving Average
    
    Parameters:
    - real: array-like, input price data
    - timeperiod: int, number of periods (default: 30)
    
    Returns:
    numpy.ndarray: TRIMA values
    """

Weighted Moving Average

Linear weighted moving average giving more weight to recent prices in a linear fashion.

def WMA(real, timeperiod=30):
    """
    Weighted Moving Average
    
    Parameters:
    - real: array-like, input price data
    - timeperiod: int, number of periods (default: 30)
    
    Returns:
    numpy.ndarray: WMA values
    """

Kaufman Adaptive Moving Average

Adaptive moving average that adjusts its smoothing based on market volatility and trending conditions.

def KAMA(real, timeperiod=30):
    """
    Kaufman Adaptive Moving Average
    
    Parameters:
    - real: array-like, input price data
    - timeperiod: int, number of periods (default: 30)
    
    Returns:
    numpy.ndarray: KAMA values
    """

Moving Average

Generic moving average function allowing selection of different MA types.

def MA(real, timeperiod=30, matype=MA_Type.SMA):
    """
    Moving Average
    
    Parameters:
    - real: array-like, input price data
    - timeperiod: int, number of periods (default: 30)
    - matype: MA_Type, type of moving average (default: SMA)
    
    Returns:
    numpy.ndarray: Moving average values
    """

MESA Adaptive Moving Average

Adaptive moving average based on MESA (Maximum Entropy Spectral Analysis) algorithm.

def MAMA(real, fastlimit=0, slowlimit=0):
    """
    MESA Adaptive Moving Average
    
    Parameters:
    - real: array-like, input price data
    - fastlimit: float, fast limit (default: 0)
    - slowlimit: float, slow limit (default: 0)
    
    Returns:
    tuple: (mama, fama) - MESA Adaptive MA and Following Adaptive MA
    """

Moving Average Variable Period

Moving average with variable time periods allowing period changes over time.

def MAVP(real, periods, minperiod=2, maxperiod=30, matype=MA_Type.SMA):
    """
    Moving Average Variable Period
    
    Parameters:
    - real: array-like, input price data
    - periods: float, period value for calculation
    - minperiod: int, minimum period allowed (default: 2)
    - maxperiod: int, maximum period allowed (default: 30)
    - matype: MA_Type, moving average type (default: SMA)
    
    Returns:
    numpy.ndarray: Variable period MA values
    """

MidPoint

Calculates the midpoint of the highest and lowest values over a specified period.

def MIDPOINT(real, timeperiod=14):
    """
    MidPoint over period
    
    Parameters:
    - real: array-like, input price data
    - timeperiod: int, number of periods (default: 14)
    
    Returns:
    numpy.ndarray: Midpoint values
    """

MidPrice

Calculates the midpoint of high and low prices over a specified period.

def MIDPRICE(high, low, timeperiod=14):
    """
    Midpoint Price over period
    
    Parameters:
    - high: array-like, high prices
    - low: array-like, low prices
    - timeperiod: int, number of periods (default: 14)
    
    Returns:
    numpy.ndarray: Midprice values
    """

Parabolic SAR

Stop and Reverse system that provides trailing stop levels and trend reversal signals.

def SAR(high, low, acceleration=0, maximum=0):
    """
    Parabolic SAR
    
    Parameters:
    - high: array-like, high prices
    - low: array-like, low prices
    - acceleration: float, acceleration factor (default: 0)
    - maximum: float, maximum acceleration (default: 0)
    
    Returns:
    numpy.ndarray: SAR values
    """

Parabolic SAR Extended

Extended version of Parabolic SAR with additional customization parameters.

def SAREXT(high, low, startvalue=0, offsetonreverse=0, accelerationinitlong=0, 
           accelerationlong=0, accelerationmaxlong=0, accelerationinitshort=0, 
           accelerationshort=0, accelerationmaxshort=0):
    """
    Parabolic SAR Extended
    
    Parameters:
    - high: array-like, high prices
    - low: array-like, low prices
    - startvalue: float, start value (default: 0)
    - offsetonreverse: float, offset on reverse (default: 0)
    - accelerationinitlong: float, initial acceleration for long positions (default: 0)
    - accelerationlong: float, acceleration for long positions (default: 0)
    - accelerationmaxlong: float, maximum acceleration for long positions (default: 0)
    - accelerationinitshort: float, initial acceleration for short positions (default: 0)
    - accelerationshort: float, acceleration for short positions (default: 0)
    - accelerationmaxshort: float, maximum acceleration for short positions (default: 0)
    
    Returns:
    numpy.ndarray: Extended SAR values
    """

Triple Exponential Moving Average (T3)

Smoothed moving average with optional volume factor for fine-tuning responsiveness.

def T3(real, timeperiod=5, vfactor=0):
    """
    Triple Exponential Moving Average (T3)
    
    Parameters:
    - real: array-like, input price data
    - timeperiod: int, number of periods (default: 5)
    - vfactor: float, volume factor (default: 0)
    
    Returns:
    numpy.ndarray: T3 values
    """

Hilbert Transform Trendline

Uses Hilbert Transform to generate instantaneous trendline values.

def HT_TRENDLINE(real):
    """
    Hilbert Transform - Instantaneous Trendline
    
    Parameters:
    - real: array-like, input price data
    
    Returns:
    numpy.ndarray: Trendline values
    """

Install with Tessl CLI

npx tessl i tessl/pypi-ta-lib

docs

abstract-streaming.md

cycle-indicators.md

index.md

math-operations.md

momentum-indicators.md

overlap-studies.md

pattern-recognition.md

price-transform.md

statistical-functions.md

volatility-indicators.md

volume-indicators.md

tile.json