state#
tradeexecutor.state Python module in Trading Strategy framework.
Module description#
Strategy execution state.
This module defines data structures used to manage the strategy execution.
The internal data is a nested tree structure starting with
tradeexecutor.state.state.State
root class.The state includes portfolios, open and closed positions, trades being currently executed, deposits and withdraws, portfolio valuation events and such.
The whole state must be serialisable as JSON, so that the JavaScript clients can read it.
The same state structure is used for both backtesting (simulation) and live trading
The application also internally stores its state as a flat file on the disk, see
tradeexecutor.state.store
For an overview, see architecture documentation.
Submodules#
Balance update data. |
|
Tracking of blockchain transactions. |
|
Frozen position management. |
|
Base class for trading and reserve positions. |
|
Asset and trading pair identifiers. |
|
Metadata describes strategy for website rendering. |
|
Serialise complex Python types to JSON using pickled hex. |
|
Portfolio state management. |
|
Trading position state info. |
|
Maanually repair broken states. |
|
Strategy reserve currency management. |
|
Position valuation state management. |
|
Trade executor state. |
|
Various statistics calculated across portfolios and positions. |
|
State serialisation to disk and JavaScript clients. |
|
"Store information about caught up chain state. |
|
Trade execution state info. |
|
Type aliases for state data structures. |
|
Uptime statistics. |
|
Stateful data validation. |
|
Visualisation of a strategy. |