StrategySummaryStatistics#
API documentation for 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>, launched_at=None, first_trade_at=None, last_trade_at=None, enough_data=None, current_value=None, profitability_90_days=None, return_all_time=None, return_annualised=None, compounding_unrealised_trading_profitability=None, performance_chart_90_days=None, share_price_returns_90_days=None, nav_90_days=None, key_metrics=<factory>, backtest_metrics_cut_off_period=None, cycle_duration=None)#
- Parameters:
- Return type:
None
Methods
__init__
([calculated_at, launched_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
When these stats where calculated
When this trade executor was launched first time.
When this strategy truly started.
When was the last time this strategy made a trade
Has the strategy been running 90 days so that the annualised profitability can be correctly calcualted.
Total equity of this strategy.
Profitability of last 90 days
All time returns, %
Annualised returns, %
Performance chart used in the summary card.
OLD Data for the performance chart used in the summary card.
Display the strategy returns as the function of the share price
Display total value locked (NAV) for the last 90 days
Strategy performance metrics to be displayed on the summary card
After which period the default metrics will switch from backtested data to live data.
Duration of each trade cycle
- launched_at: Optional[datetime]#
When this trade executor was launched first time.
If the trade-executor needs reset, this value is reset as well.
- first_trade_at: Optional[datetime]#
When this strategy truly started.
We mark the time of the first trade when the strategy started to perform.
- enough_data: Optional[bool]#
Has the strategy been running 90 days so that the annualised profitability can be correctly calcualted.
- current_value: Optional[float]#
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]#
Profitability of last 90 days
If
enough_data
is set we can display this annualised, otherwise we can say so sar.Based on Compounding realised positions profit.
- return_all_time: Optional[float]#
All time returns, %
Based on Compounding realised positions profit.
- return_annualised: Optional[float]#
Annualised returns, %
Based on Compounding realised positions profit.
- compounding_unrealised_trading_profitability: Optional[List[Tuple[float, float]]]#
Performance chart used in the summary card.
Contains frequenetly snapshotted performance
Contains (UNIX time, performance %) tuples.
- performance_chart_90_days: Optional[List[Tuple[float, float]]]#
OLD Data for the performance chart used in the summary card.
Contains only samples at position close events
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.
Based on Compounding realised positions profit.
Display the strategy returns as the function of the share price
Display total value locked (NAV) for the last 90 days
- key_metrics: Dict[str, KeyMetric]#
Strategy performance metrics to be displayed on the summary card
We use
KeyMetricKind
value as the key.
- backtest_metrics_cut_off_period: Optional[timedelta]#
After which period the default metrics will switch from backtested data to live data.
This mostly affects strategy summary tiles.
- cycle_duration: Optional[CycleDuration]#
Duration of each trade cycle
- __init__(calculated_at=<factory>, launched_at=None, first_trade_at=None, last_trade_at=None, enough_data=None, current_value=None, profitability_90_days=None, return_all_time=None, return_annualised=None, compounding_unrealised_trading_profitability=None, performance_chart_90_days=None, share_price_returns_90_days=None, nav_90_days=None, key_metrics=<factory>, backtest_metrics_cut_off_period=None, cycle_duration=None)#
- Parameters:
- Return type:
None