fix(backtest): ensure data_source is passed through all validation calls

- Pass data_source to derive_entry_spot in backtests.py
- Remove default 'synthetic' value for data_source in derive_entry_spot and validate_preview_inputs
- Update all tests to explicitly pass data_source parameter
- Improve error message with helpful suggestion for Databento/Yahoo Finance
This commit is contained in:
Bu5hm4nn
2026-03-30 09:21:49 +02:00
parent eaaf78cd12
commit 2d1ecc2fcf
3 changed files with 12 additions and 6 deletions

View File

@@ -260,6 +260,7 @@ def _render_backtests_page(workspace_id: str | None = None) -> None:
"GLD",
date.fromisoformat(DEFAULT_BACKTEST_START),
date.fromisoformat(DEFAULT_BACKTEST_END),
data_source="databento", # Use databento for default dates
)
except ValueError:
# Fixture source may not support the default date range
@@ -510,6 +511,7 @@ def _render_backtests_page(workspace_id: str | None = None) -> None:
symbol,
parse_iso_date(start_input.value, "Start date"),
parse_iso_date(end_input.value, "End date"),
data_source=str(data_source_select.value),
)
except (ValueError, KeyError) as exc:
return None, str(exc)