
Self-Tuner: Building an Adaptive Position Sizing System in Python
Originally published at chudi.dev A strategy that works on average might not work in all market conditions. Position sizing that is fixed ignores this. A self-tuner adapts. This post covers the architecture of a self-tuning position sizing system for a prediction market bot: how it reads its own trade history, computes a performance score, and translates that score into a bet size multiplier — without overfitting to variance or blowing up during quiet periods. TL;DR The tuner reads recent trade outcomes from SQLite and computes a performance score Performance score drives a multiplier (0.5x to 1.5x) applied to base bet size Lookback window should match your strategy's mean reversion speed — not be as long as possible Hard clamps prevent the tuner from ever sizing at 0% or above a safe ceiling A circuit breaker (separate from tuning) provides a hard stop on consecutive losses Why Self-Tune? A fixed position size of $15 treats a period where your strategy is firing at 75% win rate the sa
Continue reading on Dev.to Python
Opens in a new tab



