Side Project

Algorithmic Trading

Quantitative crypto strategies built with Python. I research in VectorBT Pro, validate with walk-forward testing, and deploy on the Jesse trading framework. The philosophy: many simple strategies running in parallel instead of one "perfect" system.

Python Jesse VectorBT Pro Optuna Binance Futures

The Approach

I've built 14 trading strategies so far. 3 of them passed walk-forward validation and are ready for live deployment. The rest got killed during testing, which is exactly how it should work. You build a lot, test rigorously, and only run the ones that survive out-of-sample evaluation.

The core idea is quantity over complexity. Instead of trying to build one genius strategy that works in all market conditions, I run multiple simple strategies simultaneously. Each one has a small edge in specific conditions. Together, they reduce variance and compound returns.

Edison ran multiple simple businesses at the same time and killed the underperformers. Same logic applies to trading strategies.

Strategy Results

My best strategy is RegimeSwitch, a deterministic regime detection system. It classifies the market into four states: trending bull, trending bear, ranging, and volatile. Each state triggers different entry logic. In trending markets it uses MACD crossovers. In ranging markets it switches to mean reversion with Bollinger Bands and RSI. In volatile conditions it stays flat to preserve capital.

+118.7% Best Return (BTC)
2.17 Sharpe Ratio
-15.7% Max Drawdown

I initially tried using Hidden Markov Models for regime detection. Spent a lot of time in the strategy-lab testing GaussianHMM and GaussianMixture models. They kept blowing up with singular covariance matrices and unstable state assignments. The deterministic approach with ADX, EMA 200, and Bollinger Band width turned out to be more robust and easier to optimize. Sometimes the boring solution wins.

Walk-Forward Validation

Every strategy goes through rigorous out-of-sample testing before I'd consider running it live. I use VectorBT Pro's walk-forward cross-validation with 10 rolling splits, 180-day windows, and a 70/30 train/test ratio. Each split tests 1,296 parameter combinations.

The selection function weights multiple metrics: 25% Sharpe ratio, 25% win rate, 25% daily trading frequency, 15% profit factor, and 10% drawdown control. This prevents the optimizer from just picking the highest-return parameter set, which is usually overfit.

RegimeSwitch on DOGE-USDT scored a 3.06 average test Sharpe with 90% positive out-of-sample splits and only a 9% overfitting gap. That's high confidence. BTC was solid too but showed a larger overfitting gap (54%), so I monitor that one more carefully.

The Live Trading Plugin

Jesse's official live trading plugin is closed-source and compiled from Cython. I needed features it didn't have, so I reverse-engineered the compiled C files and rebuilt the entire thing in Python from scratch.

The result is 5,000+ lines of Python across 11 modules with 158 tests covering unit, live trading, session resume, REST integration, and WebSocket integration. Key improvements over the original: no license requirements, termination reason tracking, and auto-resume so sessions survive server restarts via FastAPI startup hooks.

I also built a custom Binance Futures Testnet driver so I could run integration tests against a real exchange without risking actual money. The production deployment runs on my server at jesse.cwirz.com with GitLab CI/CD handling the pipeline. Merge requests spin up paper trading review apps automatically.

All Strategies

RegimeSwitch (BTC)

+118.7% return, Sharpe 2.17, max drawdown -15.7%. Walk-forward validated. Best overall performer. Deterministic regime detection with adaptive entry logic.

RegimeSwitch (DOGE)

+50.2% return, Sharpe 1.58, max drawdown -23.5%. 90% positive out-of-sample splits. Lowest overfitting gap of all strategies at 9%.

SuperTrendEMA (DOGE)

+201.9% return over 25 months. Sharpe 1.25 with a -46.1% max drawdown. High returns but the drawdown is rough. Only for accounts that can stomach it.

MACD30MLong (BTC)

+69.4% return, Sharpe 1.63, max drawdown -17.5%. More conservative than RegimeSwitch. Paper-trade ready as a portfolio diversifier.

Tech Stack

Python 3.11 Jesse Framework VectorBT Pro Optuna + Ray Binance Perpetual Futures PostgreSQL Redis FastAPI Docker GitLab CI/CD TA-Lib pandas / numpy

Interested in quantitative trading or want to talk strategy development?