Skip to content

TradingSeries — Series for Trading Strategies Module

The TradingSeries module provides a broad collection of classes that represent various financial indicators, price points, candlestick patterns, and volume-based signals. These series can be used inside conditions to define complex trading strategies.

Most of the TradingSeries build upon the indicators from indicators module, but they are designed to be used in conditions with other TradingSeries classes.

All TradingSeries classes inherit from the abstract base class TradingSeries, which defines a consistent interface for calculating and serializing the series.


Abstract Base: TradingSeries

All trading series inherit from this abstract class, ensuring a consistent interface for indicator calculation.

class TradingSeries(ABC):
    def __init__(self, ticker: str):
        self._ticker = ticker  # Store the ticker symbol as a protected attribute

    @property
    @abstractmethod
    def ticker(self) -> str:
        pass

    @abstractmethod
    def get_data(self, downloader: DownloadModule, df: pd.DataFrame) -> pd.Series:
        pass

    @abstractmethod
    def get_name(self) -> str:
        pass

    @abstractmethod
    def to_dict(self) -> dict:
        pass
  • ticker() -> str: Returns the ticker symbol associated with the series.
  • get_data(downloader: DownloadModule, df: pd.DataFrame) -> pd.Series: Fetches the data for the series using the provided downloader and DataFrame.
  • get_name() -> str: Returns a human-readable name of the series.
  • to_dict() -> dict: Serializes the series into a dictionary for testing purposes.

Available Trading Series

Below is a complete list of all implemented TradingSeries classes in alphabetical order. There is a link for each class to its documentation, which includes a description of the class and its parameters

  • ADX - Average Directional Index Trading Series
  • AROON_DOWN - Aroon Down Trading Series
  • AROON_UP - Aroon Up Trading Series
  • ATR - Average True Range Trading Series
  • BBP - Bull and Bear Power Trading Series
  • BB_LOWER - Bollinger Bands Lower Band Trading Series
  • BB_MIDDLE - Bollinger Bands Middle Band Trading Series
  • BB_UPPER - Bollinger Bands Upper Band Trading Series
  • CCI - Commodity Channel Index Trading Series
  • CCI_SMOOTHENED - Smoothed Commodity Channel Index Trading Series
  • CHAIKIN_OSC - Chaikin Oscillator Trading Series
  • CHOP - Choppiness Index Trading Series
  • CLOSE - Closing Price Trading Series
  • CMF - Chaikin Money Flow Trading Series
  • CMO - Chande Momentum Oscillator Trading Series
  • CONST - Constant Value Trading Series
  • COPPOCK - Coppock Curve Trading Series
  • DC_BASIS - Donchian Channel Basis Trading Series
  • DC_LOWER - Donchian Channel Lower Band Trading Series
  • DC_UPPER - Donchian Channel Upper Band Trading Series
  • DI_MINUS - Directional Movement Index Minus Trading Series
  • DI_PLUS - Directional Movement Index Plus Trading Series
  • DPO - Detrended Price Oscillator Trading Series
  • EFI - Elder Force Index Trading Series
  • EMA - Exponential Moving Average Trading Series
  • EOM - Ease of Movement Trading Series
  • HAMMER - Hammer Candlestick Pattern Trading Series
  • HIGH - Highest Price Trading Series
  • ICHIMOKU_BASE - Ichimoku Base Line (Kijun-sen)
  • ICHIMOKU_CONVERSION - Ichimoku Conversion Line (Tenkan-sen)
  • ICHIMOKU_LAGGING_SPAN - Ichimoku Lagging Span (Chikou Span)
  • ICHIMOKU_LEADING_SPAN_A - Ichimoku Leading Span A (Senkou Span A)
  • ICHIMOKU_LEADING_SPAN_B - Ichimoku Leading Span B (Senkou Span B)
  • KC_LOWER - Keltner Channel Lower Band Trading Series
  • KC_UPPER - Keltner Channel Upper Band Trading Series
  • KST - Know Sure Thing Trading Series
  • KST_SIGNAL - Know Sure Thing Signal Line Trading Series
  • LOW - Lowest Price Trading Series
  • MACD - Moving Average Convergence Divergence Trading Series
  • MACD_SIGNAL - Moving Average Convergence Divergence Signal Line Trading Series
  • MASS - Mass Index Trading Series
  • MFI - Money Flow Index Trading Series
  • MOMENTUM - Momentum Trading Series
  • OBV - On Balance Volume Trading Series
  • OPEN - Opening Price Trading Series
  • PERCENT_D - Stochastic %D Trading Series
  • PERCENT_K - Stochastic %K Trading Series
  • PVI - Positive Volume Index Trading Series
  • PVT - Price Volume Trend Trading Series
  • ROC - Rate of Change Trading Series
  • RSI - Relative Strength Index Trading Series
  • SMA - Simple Moving Average Trading Series
  • TRIX - Triple Exponential Average Trading Series
  • UO - Ultimate Oscillator Trading Series
  • VOLUME - Volume Trading Series
  • WILLR - Williams %R Trading Series