You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Full backtesting engine that reads Parquet snapshots and simulates a swing-trading strategy with no look-ahead bias. ## New modules (libs/backtest/) - domain.py: All Pydantic v2 models (Candidate, PlannedOrder, FilledTrade, OpenPosition, DailyPortfolioState, MetricsBundle, BacktestConfig, etc.) - calendar.py: Thin wrappers over time_utils + reaction_date - manifests.py: Config load/deep-merge/validate, run-ID generation - metrics.py: 21 pure-function metrics (no pandas, stdlib statistics only) - selector.py: build_candidate(), rank_candidates() (score↓ ADV↓ symbol↑) - allocator.py: 7-gate run_entry_gates(), ATR stop, floor() shares - execution.py: simulate_entry/exit(), update_trailing_stop() (ratchet-up only) - splits.py: Walk-forward windows, year/regime split utilities - snapshot_store.py: Sync load() → asyncio.run(_async_load()), no look-ahead - artifacts.py: Full run-dir writer (Parquet, CSV, JSON) ## App modules (apps/backtester/) - run.py: BacktestRunner (exit-first→entry simulation, 25% kill switch) + CLI - replay.py: Double-run determinism checker ## Config files - configs/backtest/defaults.json: Base strategy defaults - configs/experiments/baseline_v1.json: First experiment manifest ## Tests: 142 new tests, all passing - 132 unit tests (no DB/HTTP required) - 8 integration tests (synthetic SnapshotStore) - 3 backtest determinism/replay tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
5 months ago | |
|---|---|---|
| .. | ||
| backtest | 5 months ago | |
| __init__.py | 5 months ago | |
| test_config.py | 5 months ago | |
| test_db_models.py | 5 months ago | |
| test_event_features.py | 5 months ago | |
| test_file_store.py | 5 months ago | |
| test_financial_features.py | 5 months ago | |
| test_fred_service.py | 5 months ago | |
| test_ids.py | 5 months ago | |
| test_labeler.py | 5 months ago | |
| test_llm_cache.py | 5 months ago | |
| test_llm_client.py | 5 months ago | |
| test_llm_parser_stub.py | 5 months ago | |
| test_logging.py | 5 months ago | |
| test_market_features.py | 5 months ago | |
| test_merger.py | 5 months ago | |
| test_oracle_client.py | 5 months ago | |
| test_retries.py | 5 months ago | |
| test_review_queue.py | 5 months ago | |
| test_rule_parser.py | 5 months ago | |
| test_schema_validator.py | 5 months ago | |
| test_snapshot_export.py | 5 months ago | |
| test_text_normalizer.py | 5 months ago | |
| test_time_utils.py | 5 months ago | |