Anyone can write a script that "kind of works." Building something a real business could rely on means investing
just as much effort in the things you cannot see : testing, validation, monitoring, documentation. Here is what
that looked like for this project.
Modular architecture
The codebase is organised into 30+ Python modules with a single shared core (hurst_cyclic_trading.py).
Every backtest, validation pipeline, and the live trading bot all import from the same source of truth — so
what is tested in simulation is exactly what runs in production. No drift, no surprises.
Validation pipeline
Three independent layers of validation prove the system works: walk-forward testing on unseen
historical data, Monte Carlo simulation to stress-test against thousands of randomised
scenarios, and ablation studies that disable individual components to measure their isolated
contribution. Together they answer the only question that matters: is this real, or did I overfit?
Observability
Structured logging at every stage with consistent timestamps and severity levels, a per-session JSON metrics
file, and a trade journal that records the full lifecycle of every decision. When something goes wrong, the
first 30 seconds of debugging start from data, not guesswork.
Configuration as code
All tunable parameters — risk per trade, confidence thresholds, asset universe, schedule, live in versioned
configuration files. Switching between paper trading and live deployment is a single flag, not a code change.
Defensive design
Hard-coded daily loss limits, mandatory stop-loss orders, automatic position size caps, and graceful handling
of API failures. The system is built on the assumption that things will go wrong, and that the right
response is to fail safely and log loudly, not silently.
Version control & documentation
The whole project is tracked in Git with descriptive commits and feature branches. Architecture decisions,
validation results, and operational runbooks are documented in over 100 markdown files alongside the code,
so the project remains understandable to a future maintainer — including future me.