PORTFOLIO/SYSTEMS/QuantFlow

QuantFlow

+28% out-of-sample Sharpe stability via purged walk-forward CV

Algorithmic trading engine with ML-driven backtesting

00 / TECHNOLOGY
Language
Python
ML
XGBoostRandom ForestScikit-learnpurged walk-forward CV
Data
NumPyPandas
MLOps
MLflowPydanticYAML schemas
API
FastAPI
Metrics
SharpeSortinoCalmarMax Drawdown
01 / FORMULATION

Problem formulation

Evaluating quantitative trading strategies on non-stationary financial time series suffers from critical lookahead bias when using naive k-fold cross validation. Information leaks from future price bars into past training partitions, inflating historical Sharpe ratios that immediately degrade out-of-sample. Concurrently, iterative loop-based simulation engines are too slow to benchmark 50+ hyperparameter configurations across 100K+ historical OHLCV bars.

02 / ARCHITECTURE

Subsystem topology

VALIDATION PIPELINE|PURGED WALK-FORWARD CROSS VALIDATION
BARS: 100K+ // SHARPE STABILITY: +28%
01 // INGESTION & FEATURES100K+ OHLCV Time-SeriesVectorized NumPy / Pandas+65% SIMULATION SPEEDNo iterative loop overheadPydantic YAML GovernanceSTREAM02 // TEMPORAL SPLIT (PURGED WALK-FORWARD CV WITH EMBARGO)ZERO FUTURE LEAKAGEt_0t_N (CHRONOLOGICAL)TRAIN FOLD (t_0 → t_i)PURGETEST FOLDEMBARGOFOLD k+1 TRAINEXPANDING WINDOW TRAINPURGETEST FOLDEMBARGOOOSPurge eliminates overlapping label leakage; Embargo eliminates autoregressive spillover.03 // MLFLOW EXPERIMENT BENCHMARKING (50+ RUNS)XGBOOST CLASSIFIERWalk-Forward ValidatedHyperparameter TunedRANDOM FOREST ENSEMBLEPurged Walk-Forward CVConfigurable Embargo+28% SHARPE RATIO STABILITYOut-of-sample risk metrics benchmarked:Sortino · Calmar · Maximum Drawdown (MDD)MLFLOW EXPERIMENT ID: 50+ ARTIFACT RUNS WITH FULL WEIGHT & CONFIG REPRODUCIBILITY
FIG. 01ARCHITECTURAL TOPOLOGY & SUBSYSTEM DATAFLOW

QuantFlow processes 100K+ OHLCV time-series records through a vectorized NumPy/Pandas feature pipeline, executing simulations 65% faster than iterative baselines. The core engine applies Purged Walk-Forward Cross Validation to enforce chronological separation between training and test sets.

A configurable purge window discards overlapping label horizons, while an embargo period buffers post-test samples to eliminate autoregressive serial correlation. Hyperparameter tuning benchmarks across 50+ runs are governed via Pydantic YAML schemas and tracked in MLflow, achieving +28% out-of-sample Sharpe ratio stability.

03 / TRADE-OFFS

Architectural decisions

DECISION 01

Vectorized NumPy/Pandas feature pipelines

Cuts simulation execution time by 65% compared to iterative baselines across 100K+ OHLCV bars.

DECISION 02

Purged walk-forward cross-validation with configurable embargo periods

Eliminates data leakage on non-stationary financial series, improving out-of-sample Sharpe stability by 28%.

DECISION 03

Pydantic-validated YAML schemas with MLflow tracking

Automates experiment governance to benchmark 50+ hyperparameter runs across Sortino, Calmar, and Maximum Drawdown metrics.