A small (MVP) quant research framework that keeps the data/time semantics honest. Strategies are built as a pipeline with explicit “what you can know when” rules, so timing and leakage mistakes become testable failures.
The pipeline goes left-to-right:
data -> features -> signals -> fusion -> portfolio -> execution -> backtest -> evaluation.
Step 1’s goal is to define shared contracts between layers, via:
DataPipeline, FeatureEngineer, SignalModel, SignalFusion,
PortfolioConstructor, ExecutionSimulator, BacktestEngine, Evaluator.
configs/: YAML experiment configuration (the MVP lives here)data/: data staging (raw/,interim/,processed/,artifacts/)docs/: documentation (queued for deeper Step 1 write-ups)notebooks/: exploratory workscripts/: runnable entrypoints (runner stub planned for Step 1)reports/: outputs from backtests/evaluationssrc/qtrading/: the Python packagecore/: shared schemas + abstract interfaces + MVP config modelsvalidation/: timing/leakage validators with unit testsdata/,features/,signals/,models/,portfolio/,execution/,backtest/,evaluation/,utils/: placeholders for implementations
tests/: unit tests
Core contracts in src/qtrading/core/:
types.py: dataclass “shapes” for bars/features/signals/orders/fills/positions/resultsinterfaces.py: ABCs for each pipeline layerclock.py: MVP timestamp semantics helpers (horizon labeling + feature lag)
Config + YAML in src/qtrading/core/config.py + configs/:
MVPConfig: validated MVP settings (horizon/lag, rebalance cadence, costs, constraints)configs/base.yaml: base MVP defaultsconfigs/experiments/mvp_daily_ls_wproxy.yaml: an example experiment config
Timing/leakage validation in src/qtrading/validation/:
leakage_checks.py:validate_lagged_features+validate_forward_return_labelstests/test_timing_contracts.py: synthetic tests to catch common alignment mistakes
- Install deps:
python -m pip install -r requirements.txt
- Run tests:
pytest
- Lint (optional if
ruffis installed):ruff check .