ExecutionMode#
tradeexecutor.strategy.execution_context.ExecutionMode Python class in Trading Strategy framework.
- class ExecutionMode[source]#
Bases:
Enum
Different execution modes the strategy engine can hvae.
- __init__()#
Methods
Are we trading real time?
Should we purge caches for each trade cycle.
Are we executing unit tests.
Attributes
We are live trading with real assets
We are live trading with mock assets TODO: This mode is not yet supported
We are backtesting When backtesting mode is selected, we can skip most of the statistical calculations that would otherwise be calculated during live-trade.
We are loading and caching datasets before a backtesting session can begin.
We are operating on real datasets like
real_trading
but we do not want to purge caches.Simulated trading: Blockchain we are connected is not real.
Prefilight checks
One off diagnostic and scripts
- real_trading = 'real_trading'#
We are live trading with real assets
- paper_trading = 'paper_trading'#
We are live trading with mock assets TODO: This mode is not yet supported
- backtesting = 'backtesting'#
We are backtesting When backtesting mode is selected, we can skip most of the statistical calculations that would otherwise be calculated during live-trade. This offers great performance benefits for backtesting.
- data_preload = 'data_preload'#
We are loading and caching datasets before a backtesting session can begin. We call create_trading_universe() and assume
tradingstrategy.client.Client
class is set to a such state it can display nice progress bar when loading data in a Jupyter notebook.
- unit_testing_trading = 'unit_testing_trading'#
We are operating on real datasets like
real_trading
but we do not want to purge caches.This mode is specially used to test some live trading features.
- simulated_trading = 'simulated_trading'#
Simulated trading: Blockchain we are connected is not real.
We are trading against a simulated step-by-step blockchain like EthereumTester. This allows us to control block production, but otherwise behave as live trading.
In this mode, we are also not using any dataset loading features, but the trading universe and price feeds are typed in the test code.
- preflight_check = 'preflight_check'#
Prefilight checks
In this execution mode, we are invoked from the command line to check that all of our files and connections are intact.
- one_off = 'one_off'#
One off diagnostic and scripts
Used in the interactive :ref:`console. and debugging scripts.