StrategySummaryStatistics#
tradeexecutor.strategy.summary.StrategySummaryStatistics Python class in Trading Strategy framework.
- class StrategySummaryStatistics[source]#
Bases:
object
Performance statistics displayed on the tile cards.
- __init__(calculated_at=<factory>, first_trade_at=None, last_trade_at=None, enough_data=None, current_value=None, profitability_90_days=None, performance_chart_90_days=None)#
- Parameters:
- Return type:
None
Methods
__init__
([calculated_at, first_trade_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
Total equity of this strategy.
Has the strategy been running 90 days so that the annualised profitability can be correctly calcualted.
When this strategy truly started.
When was the last time this strategy made a trade
Data for the performance chart used in the summary card.
Profitability of last 90 days
When these stats where calculated
- first_trade_at: Optional[datetime] = None#
When this strategy truly started.
We mark the time of the first trade when the strategy started to perform.
- enough_data: Optional[bool] = None#
Has the strategy been running 90 days so that the annualised profitability can be correctly calcualted.
- current_value: Optional[float] = None#
Total equity of this strategy.
Also known as Total Value locked (TVL) in DeFi. It’s cash + open hold positions
- profitability_90_days: Optional[float] = None#
Profitability of last 90 days
If
enough_data
is set we can display this annualised, otherwise we can say so sar.
- performance_chart_90_days: Optional[List[Tuple[datetime, float]]] = None#
Data for the performance chart used in the summary card.
Contains (UNIX time, performance %) tuples.
Relative performance -1 … 1 (100%) up and 0 is no gains/no losses.
One point per day. Note that we might have 90 or 91 points because date ranges are inclusive.
- __init__(calculated_at=<factory>, first_trade_at=None, last_trade_at=None, enough_data=None, current_value=None, profitability_90_days=None, performance_chart_90_days=None)#
- Parameters:
- Return type:
None