PositionStatistics#
tradeexecutor.state.statistics.PositionStatistics Python class in Trading Strategy framework.
- class PositionStatistics[source]#
Bases:
object
Time-series of statistics calculated for each open position.
Position statistics are recalculated at the same time positions are revalued. The time-series of these statistics are stored as a part of the state, allowing one to plot the position performance over time.
- __init__(calculated_at, last_valuation_at, profitability, profit_usd, quantity, value)#
Methods
__init__
(calculated_at, last_valuation_at, ...)from_dict
(kvs, *[, infer_missing])from_json
(s, *[, parse_float, parse_int, ...])schema
(*[, infer_missing, only, exclude, ...])to_dict
([encode_json])to_json
(*[, skipkeys, ensure_ascii, ...])Attributes
Real-time clock when these stats were calculated
When this position was revalued last time.
Profitability %
How much profit we made so far
The current number of owned units
The current position size dollars