strategy#

tradeexecutor.strategy Python module in Trading Strategy framework.

Module description#

Strategy core - the internal state data structures.

This is the code of the strategy execution engine. We define how the data structures look like and what actions are possible.

All data structures are based on dataclass DLS and dataclasses_json serialisation.

The main tradeexecutor.state.State class serialises the whole strategy execution state in one go and passes it to the web client as one JSON download.

Submodules#

tradeexecutor.strategy.account_correction

Apply accounting corrections on the strategy state.

tradeexecutor.strategy.alpha_model

Alpha model and portfolio construction model related logic.

tradeexecutor.strategy.approval

Trade approval models.

tradeexecutor.strategy.asset

Asset management helpers.

tradeexecutor.strategy.bootstrap

Loading Python strategy modules.

tradeexecutor.strategy.cycle

Strategy cycle definitions.

tradeexecutor.strategy.default_routing_options

Default routing options for trading strategies.

tradeexecutor.strategy.description

Strategy execution description.

tradeexecutor.strategy.dummy

A testing executoin model without actual execution.

tradeexecutor.strategy.execution_context

Execution modes.

tradeexecutor.strategy.execution_model

Strategy execution model.

tradeexecutor.strategy.factory

Strategy initialisation using factory design pattern.

tradeexecutor.strategy.output

Helpers for outputting strategy execution information to Python logging and Discord.

tradeexecutor.strategy.pandas_trader

Trading Strategy internal strategy types using Pandas data and decide_trades functino.

tradeexecutor.strategy.pricing_model

Asset pricing model.

tradeexecutor.strategy.qstrader

QSTrader portfolio construction model based strategy types.

tradeexecutor.strategy.reserve_currency

Reserve currency options for strategies.

tradeexecutor.strategy.reverse_universe

Universe reverse loading.

tradeexecutor.strategy.routing

Trade routing instructions.

tradeexecutor.strategy.run_state

Execution state communicates the current trade execution loop state to the webhook.

tradeexecutor.strategy.runner

Strategy execution core.

tradeexecutor.strategy.stop_loss

Stop loss trade logic.

tradeexecutor.strategy.strategy_cycle_trigger

Strategy cycle trigger.

tradeexecutor.strategy.strategy_module

Describe strategy modules and their loading.

tradeexecutor.strategy.strategy_type

Declarate what kind of strategy types our strategy loader and backtesting framework supports.

tradeexecutor.strategy.summary

Strategy status summary.

tradeexecutor.strategy.sync_model

Strategy deposit and withdrawal syncing.

tradeexecutor.strategy.trade_pricing

tradeexecutor.strategy.trading_strategy_universe

Trading Strategy oracle data integration.

tradeexecutor.strategy.universe_model

Construct the trading universe for the strategy.

tradeexecutor.strategy.valuation

Valuation models for the portfolio.

tradeexecutor.strategy.weighting

Weighting based portfolio manipulation.