Everything is in github.com/jahrfm/trading-components — code, the runs/*.json audit trail for all 45 backtests, and the HANDOFF that records every decision and caveat. The framework is pure Python (pandas/numpy/scipy + ccxt, yfinance, cot_reports), stdlib-adjacent, and runs on any machine.
trading-components/
├── trading-tools-eval/ # the whole evaluation framework
│ ├── src/
│ │ ├── config.py # symbols, timeframes, cost schedule, regime periods, WF windows
│ │ ├── data/ # bybit.py (ccxt) · yfinance_source.py · cot.py (CFTC) · schema.py
│ │ ├── backtest/ # engine.py (no-lookahead) · costs.py · walkforward.py · sweep.py
│ │ ├── evaluation/ # metrics.py · significance.py · pass_bar.py · regime_split.py · regime_filter_eval.py
│ │ └── signals/ # one module per tool, grouped by element (16 families)
│ ├── scripts/ # one run_<tool>.py per tool → writes runs/<tool>.json
│ ├── runs/ # 46 JSON audit files (45 backtests + multiple-testing correction)
│ ├── tests/ # 85 unit tests across 9 modules (engine, costs, metrics, pass bars, …)
│ ├── data/cache/ # parquet cache, regenerable (gitignored)
│ ├── HANDOFF.md # the full project record: results table, caveats, known issues, methodology
│ ├── pyproject.toml # pytest config
│ └── requirements.txt
├── site/ # this website (static, no build step)
│ ├── index.html … repo.html
│ ├── assets/ # style.css · site.js · results_data.json (generated)
│ └── scripts/build_results_data.py # regenerates the results dataset from runs/
└── handoff_prompt.md # the original task brief
git clone git@github.com:jahrfm/trading-components.git
cd trading-components/trading-tools-eval
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# run one tool end-to-end (Trend / Moving Average Crossover):
python scripts/run_moving_average_crossover.py
# run the whole test suite:
python -m pytest tests/
The first run pulls and caches market data (a full BTCUSDT 1h history takes ~10 min against Bybit rate limits; daily data is fast). Keep data/cache/ between runs — it's gitignored and regenerable.
| Package | Used for |
|---|---|
ccxt ≥ 4.3 | Bybit v5 perp OHLCV + funding history (public endpoints, no key) |
yfinance ≥ 0.2.40 | Traditional-market OHLCV (SPY, QQQ, TLT, GLD, VIX, …) |
pandas / numpy / scipy | Data frames, vectorized engine, Spearman IC, stats |
pyarrow | Parquet cache |
arch | GARCH conditional-volatility estimation |
hmmlearn | Hidden Markov Model regime classifier |
cot_reports | CFTC Commitment of Traders report (free, no auth) |
pytest | 85-test suite |
HANDOFF.md (simple directional, continuous/IC, regime-filter classifier, risk-input overlay, portfolio-construction allocation, execution-input forecast-error, comparative hypothesis, …).The project is complete: all 18 elements covered, multiple-testing correction run (zero status changes). Nothing further is required. Natural extensions, when the user asks: