Back to portfolio
tradingdatasoftware

Momentum Alpha

Momentum Alpha

Quantitative trading system combining momentum and mean-reversion strategies on crypto and forex. Custom backtesting engine built on Polars for high-performance processing and Numba for JIT-compiled native-speed calculations. Dynamic position sizing based on volatility (ATR), adaptive stop-losses, walk-forward analysis and Monte Carlo simulation (10K runs) for stress testing. Metrics: Sharpe ratio, Sortino, max drawdown, profit factor. Real-time data via CCXT, equity curve and automated trade journal on PostgreSQL.

The problem

A strategy that looks good on a chart isn't a strategy yet: the real step is proving it holds out of sample, with realistic execution costs and without depending on a lucky test window. Momentum and mean-reversion also pull risk management in opposite directions, so sizing and exit rules have to adapt to the regime instead of staying fixed.

How we tackled it

A purpose-built backtesting engine: walk-forward analysis for out-of-sample robustness, Monte Carlo simulation over 10,000 runs to stress the trade sequence, volatility-based position sizing (ATR) and adaptive stops. The metrics reported are the uncomfortable ones — Sharpe, Sortino, max drawdown, profit factor — not the prettiest equity curve.

Technical choices

Polars and Numba to keep backtests fast enough to iterate on, CCXT for real-time crypto and forex data, PostgreSQL for the equity curve and an automatic trade journal. The engine is built to rule out lookahead: every decision sees only what existed at the bar it was taken on, otherwise the backtest just confirms itself and is worth nothing.

What it includes

Backtesting engine with walk-forward analysis, Monte Carlo simulation over 10,000 runs, ATR-based dynamic position sizing and adaptive stops, metrics reporting (Sharpe, Sortino, max drawdown, profit factor), equity curve and an automatic trade journal on PostgreSQL. Real-time crypto and forex data via CCXT, with a strict split between development and verification periods.

Technologies used

PythonPolarsNumbaNumPyPlotlyPostgreSQLCCXT