feat: add Portfolio Value, Option Value, and Contracts columns to daily results

- Add option_contracts field to BacktestDailyPoint (number of contracts held)
- Update engine to calculate total option contracts from positions
- Update job serialization to include underlying_value, option_market_value, net_portfolio_value, option_contracts
- Update both render_result and render_job_result tables to show:
  - Low, High, Close (from previous commit)
  - Portfolio value (net_portfolio_value)
  - Option value (option_market_value)
  - Contracts (option_contracts)
  - LTV hedged
  - Margin call status
This commit is contained in:
Bu5hm4nn
2026-04-05 08:54:38 +02:00
parent 7a7b191a6d
commit 6b8336ab7e
4 changed files with 69 additions and 1 deletions

View File

@@ -264,6 +264,7 @@ def run_backtest_job(
"underlying_value": dp.underlying_value,
"option_market_value": dp.option_market_value,
"net_portfolio_value": dp.net_portfolio_value,
"option_contracts": dp.option_contracts,
"ltv_hedged": dp.ltv_hedged,
"ltv_unhedged": dp.ltv_unhedged,
"margin_call_hedged": dp.margin_call_hedged,