feat(BT-003): add event preset backtest comparison
This commit is contained in:
@@ -3,6 +3,8 @@ from __future__ import annotations
|
||||
from dataclasses import dataclass, field
|
||||
from datetime import date
|
||||
|
||||
from app.models.event_preset import EventPreset
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class BacktestPortfolioState:
|
||||
@@ -107,6 +109,8 @@ class BacktestSummaryMetrics:
|
||||
total_option_payoff_realized: float
|
||||
max_ltv_unhedged: float
|
||||
max_ltv_hedged: float
|
||||
margin_call_days_unhedged: int
|
||||
margin_call_days_hedged: int
|
||||
margin_threshold_breached_unhedged: bool
|
||||
margin_threshold_breached_hedged: bool
|
||||
|
||||
@@ -125,3 +129,23 @@ class TemplateBacktestResult:
|
||||
class BacktestRunResult:
|
||||
scenario_id: str
|
||||
template_results: tuple[TemplateBacktestResult, ...]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class EventComparisonRanking:
|
||||
rank: int
|
||||
template_slug: str
|
||||
template_name: str
|
||||
survived_margin_call: bool
|
||||
max_ltv_hedged: float
|
||||
hedge_cost: float
|
||||
final_equity: float
|
||||
result: TemplateBacktestResult
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class EventComparisonReport:
|
||||
event_preset: EventPreset
|
||||
scenario: BacktestScenario
|
||||
rankings: tuple[EventComparisonRanking, ...]
|
||||
run_result: BacktestRunResult
|
||||
|
||||
Reference in New Issue
Block a user