statistics#
API documentation for tradeexecutor.state.statistics Python module in Trading Strategy.
Module description#
Various statistics calculated across portfolios and positions.
Statistics are calculated/refreshed on the server-side and exported as a part of the state. This way the clients (JavaScript) do not need to reconstruct this information.
Any statistics are optional: they are not needed to make any state transitions, they are purely there for profit and loss calculations.
Classes#
When position is closed, its final statistics are calculated.  | 
|
Portfolio statistics for each timepoint.  | 
|
Time-series of statistics calculated for each open position.  | 
|
Statistics for a trade execution state.  | 
Functions#
  | 
Calculate the profitability as value at end - value at start.  |