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 SeriesAROON_DOWN
- Aroon Down Trading SeriesAROON_UP
- Aroon Up Trading SeriesATR
- Average True Range Trading SeriesBBP
- Bull and Bear Power Trading SeriesBB_LOWER
- Bollinger Bands Lower Band Trading SeriesBB_MIDDLE
- Bollinger Bands Middle Band Trading SeriesBB_UPPER
- Bollinger Bands Upper Band Trading SeriesCCI
- Commodity Channel Index Trading SeriesCCI_SMOOTHENED
- Smoothed Commodity Channel Index Trading SeriesCHAIKIN_OSC
- Chaikin Oscillator Trading SeriesCHOP
- Choppiness Index Trading SeriesCLOSE
- Closing Price Trading SeriesCMF
- Chaikin Money Flow Trading SeriesCMO
- Chande Momentum Oscillator Trading SeriesCONST
- Constant Value Trading SeriesCOPPOCK
- Coppock Curve Trading SeriesDC_BASIS
- Donchian Channel Basis Trading SeriesDC_LOWER
- Donchian Channel Lower Band Trading SeriesDC_UPPER
- Donchian Channel Upper Band Trading SeriesDI_MINUS
- Directional Movement Index Minus Trading SeriesDI_PLUS
- Directional Movement Index Plus Trading SeriesDPO
- Detrended Price Oscillator Trading SeriesEFI
- Elder Force Index Trading SeriesEMA
- Exponential Moving Average Trading SeriesEOM
- Ease of Movement Trading SeriesHAMMER
- Hammer Candlestick Pattern Trading SeriesHIGH
- Highest Price Trading SeriesICHIMOKU_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 SeriesKC_UPPER
- Keltner Channel Upper Band Trading SeriesKST
- Know Sure Thing Trading SeriesKST_SIGNAL
- Know Sure Thing Signal Line Trading SeriesLOW
- Lowest Price Trading SeriesMACD
- Moving Average Convergence Divergence Trading SeriesMACD_SIGNAL
- Moving Average Convergence Divergence Signal Line Trading SeriesMASS
- Mass Index Trading SeriesMFI
- Money Flow Index Trading SeriesMOMENTUM
- Momentum Trading SeriesOBV
- On Balance Volume Trading SeriesOPEN
- Opening Price Trading SeriesPERCENT_D
- Stochastic %D Trading SeriesPERCENT_K
- Stochastic %K Trading SeriesPVI
- Positive Volume Index Trading SeriesPVT
- Price Volume Trend Trading SeriesROC
- Rate of Change Trading SeriesRSI
- Relative Strength Index Trading SeriesSMA
- Simple Moving Average Trading SeriesTRIX
- Triple Exponential Average Trading SeriesUO
- Ultimate Oscillator Trading SeriesVOLUME
- Volume Trading SeriesWILLR
- Williams %R Trading Series