fix benchmark return baseline

This commit is contained in:
boris
2026-04-24 00:17:20 -07:00
parent 47988cd7e7
commit e6621c1719
3 changed files with 87 additions and 20 deletions

View File

@@ -194,17 +194,18 @@ fn write_equity_curve_csv(path: &Path, rows: &[DailyEquityPoint]) -> Result<(),
let mut file = fs::File::create(path)?;
writeln!(
file,
"date,cash,market_value,total_equity,benchmark_close,notes,diagnostics"
"date,cash,market_value,total_equity,benchmark_close,benchmark_prev_close,notes,diagnostics"
)?;
for row in rows {
writeln!(
file,
"{},{:.2},{:.2},{:.2},{:.2},{},{}",
"{},{:.2},{:.2},{:.2},{:.2},{:.2},{},{}",
row.date,
row.cash,
row.market_value,
row.total_equity,
row.benchmark_close,
row.benchmark_prev_close,
sanitize_csv_field(&row.notes),
sanitize_csv_field(&row.diagnostics),
)?;
@@ -317,6 +318,7 @@ fn build_summary(
"marketValue": row.market_value,
"totalEquity": row.total_equity,
"benchmarkClose": row.benchmark_close,
"benchmarkPrevClose": row.benchmark_prev_close,
"notes": row.notes,
"diagnostics": row.diagnostics,
})