feat: add candlestick chart with portfolio value line (BT-004)

- Add spot_open field to BacktestDailyPoint for complete OHLC data
- Replace line chart with candlestick chart showing price OHLC
- Add portfolio value line on secondary Y-axis
- Add _chart_options_from_dict for rendering job results
- Update both render_result and render_job_result to use new chart
This commit is contained in:
Bu5hm4nn
2026-04-06 11:22:10 +02:00
parent aff4df325d
commit f00b1b7755
6 changed files with 129 additions and 23 deletions

View File

@@ -98,7 +98,8 @@ class BacktestDailyPoint:
margin_call_unhedged: bool
margin_call_hedged: bool
active_position_ids: tuple[str, ...] = field(default_factory=tuple)
# Optional OHLC fields for worst-case margin call evaluation
# OHLC fields for chart and margin call evaluation
spot_open: float | None = None # Day's open
spot_low: float | None = None # Day's low for margin call evaluation
spot_high: float | None = None # Day's high
# Option position info