indicator#

API documentation for tradeexecutor.strategy.pandas_trader.indicator Python module in Trading Strategy.

Module description#

Indicator definitions.

  • Defining technical analysis and external indicators for trading strategies

  • Precalculating indicators and caching the results on a disk

  • Continuing indicator calculator in the case of crash

  • Support both single backtest and grid search modes

  • Support indicators depending on other indicators via dependency order resolution using IndicatorDependencyResolver

  • Support external data sources

To get started with indicators see examples in CreateIndicatorsProtocolV2.

Classes#

CreateIndicatorsProtocolV1

Call signature for create_indicators function.

CreateIndicatorsProtocolV2

Call signature for create_indicators function.

DiskIndicatorStorage

Store calculated indicator results on disk.

IndicatorDefinition

A definition for a single indicator.

IndicatorDependencyResolver

A helper class allowing access to the indicators we depend on.

IndicatorKey

Cache key used to read indicator results.

IndicatorResult

One result of an indicator calculation we can store on a disk.

IndicatorSet

Define the indicators that are needed by a trading strategy.

IndicatorSource

The data on which the indicator will be calculated.

IndicatorStorage

Base class for cached indicators and live trading indicators.

MemoryIndicatorStorage

Store calculated indicator results on disk.

Functions#

calculate_and_load_indicators(...[, ...])

Precalculate all indicators.

calculate_and_load_indicators_inline(...[, ...])

Calculate indicators in the notebook itself, before starting the backtest.

calculate_indicators(strategy_universe, ...)

Calculate indicators for which we do not have cached data yet.

call_create_indicators(...[, timestamp])

Backwards compatible wrapper for create_indicators().

group_indicators(task_args)

Split indicator calculations to the groups based on their dependency resolution order.

load_indicators(strategy_universe, storage, ...)

Load cached indicators.

prepare_indicators(create_indicators, ...[, ...])

Call the strategy module indicator builder.

setup_indicator_multiprocessing(executor)

Set up multiprocessing for indicators.

validate_function_kwargs(func, kwargs)

Check that we can pass the given kwargs to a function.

warm_up_indicator_cache(strategy_universe, ...)

Precalculate all indicators.

wrap_nones(f)

Turn None return values to empty pandsa Series.