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>, 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, performance_chart_90_days=None, key_metrics=<factory>, backtest_metrics_cut_off_period=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

backtest_metrics_cut_off_period

After which period the default metrics will switch from backtested data to live data.

current_value

Total equity of this strategy.

enough_data

Has the strategy been running 90 days so that the annualised profitability can be correctly calcualted.

first_trade_at

When this strategy truly started.

last_trade_at

When was the last time this strategy made a trade

launched_at

When this trade executor was launched first time.

performance_chart_90_days

Data for the performance chart used in the summary card.

profitability_90_days

Profitability of last 90 days

return_all_time

All time returns, %

return_annualised

Annualised returns, %

calculated_at

When these stats where calculated

key_metrics

Strategy performance metrics to be displayed on the summary card

calculated_at: datetime#

When these stats where calculated

launched_at: Optional[datetime] = None#

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] = None#

When this strategy truly started.

We mark the time of the first trade when the strategy started to perform.

last_trade_at: Optional[datetime] = None#

When was the last time this strategy made a trade

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.

Based on Compounding realised positions profit.

return_all_time: Optional[float] = None#

All time returns, %

Based on Compounding realised positions profit.

return_annualised: Optional[float] = None#

Annualised returns, %

Based on Compounding realised positions profit.

performance_chart_90_days: Optional[List[Tuple[float, 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.

Based on Compounding realised positions profit.

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] = None#

After which period the default metrics will switch from backtested data to live data.

This mostly affects strategy summary tiles.

__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, performance_chart_90_days=None, key_metrics=<factory>, backtest_metrics_cut_off_period=None)#
Parameters:
Return type:

None