r/mltraders • • 17h ago

Simulated $1,000 across 200 trades on an identical 60/40 edge at four position sizes (5%, Half-Kelly, Full Kelly, 45%) — a visual reminder of how brutal volatility drag gets past 2f*

0 Upvotes

Everyone knows the textbook Kelly formula f* = (bp - q) / b, yet seeing the pathwise divergence between arithmetic expectation and time-average (ergodic) compounding still catches a lot of intuitive sizing heuristics off guard.

I coded a deterministic simulation walking from negative/zero-EV progression traps (9-step Martingale on a $1–$500 cap, N=1,000) all the way to non-ergodic overbetting on a genuinely profitable 60/40 even-money edge:

  1. The Non-Ergodicity Trap (p = 0.60, b = 1, staking f = 50% over 100 rounds):

• Ensemble mean across parallel paths: +10%/round → $1,000 × (1.10)^100 = $13,780,612 (13,781x)

• Typical single timeline (exact 60W / 40L): $1,000 × (1.5)^60 × (0.5)^40 = $33.46 (-96.7% drawdown)

2. 200-Round Compounding Race on the exact same shuffled sequence (120 wins / 80 losses, $1,000 start):

• Conservative (f = 5%): $5,762

• Half-Kelly (f = 10%): $20,255 (captures 75% of max log-growth rate g(f) with 25% of the variance)

• Full Kelly (f* = 20%): $56,098 (theoretical peak g(0.20) = +2.01%/round)

• Over-leveraged (f = 45%, past the 38.7% zero-growth cliff): $39 (-96.1% wipeout despite a 60% win rate)

It makes it crystal clear why Thorp and institutional desks treat Half-Kelly as an upper bound once parameter uncertainty enters p and b: underbetting by 50% costs 25% of asymptotic growth, whereas overbetting past 2f* turns a +20% EV signal into mathematical ruin.

If anyone enjoys visual stochastic simulations, I rendered the full 9-minute trajectory breakdown (from Martingale & Doob's Optional Stopping Theorem to the Kelly curve) here: https://youtu.be/bfUaw0pujzE?si=HtGLjd220QtS5H-D


r/mltraders • • 18h ago

Question Do you trade on the model's probability or just its yes/no?

0 Upvotes

When a classifier says "up", it also gives a number for how sure it is. I keep going back and forth on how much that number should matter.

For those running ML models on markets:

  • Do you only take trades above some probability cut-off, or every signal?
  • Do you size by the probability, or keep the size fixed?
  • Did you calibrate the probabilities, and did it change anything?
  • How do you pick the cut-off without just fitting it to the backtest?

Curious how you actually use it, not the textbook answer. All replies are appreciated.


r/mltraders • • 19h ago

Quantum Algortihims for the new trading engine?

0 Upvotes

🤖💰

Scared money makes no money, but your sizing math is cold-blooded! 📈🔥

I can't wait to have someone to give a compliment like this too other than my wife hahah

Just married 8 months ago she was a coder before me I graduated '22 when I started the LLC.

I see some of you literally out-pricing the market-makers right now! 🧠⚡

Keep up the good lords work genius


r/mltraders • • 22h ago

Two leakage bugs in my backtest turned a losing idea into a +$85 "winner". Not ML, but the same trap

0 Upvotes

My bot is rule-based, not ML, but I think this is the same leakage and selection problem you all deal with, so sharing in case it saves someone time.

The idea: on SOL, keep the normal trades and add extra positions with a much wider stop-loss, so they can sit through a dip and wait for the recovery. Tested walk-forward: pick the setting on the previous 6 months, trade it blind on the next quarter, 6 quarters.

First result: +$85. Looked like one of my best ideas.

Bug 1, dropped outcomes. Trades that hadn't hit their stop or target by the end of a test window were silently dropped instead of marked at the window's last price. So the trades stuck underwater just disappeared from the results. Basically survivorship bias inside my own test.

Bug 2, look-ahead across windows. Trades opened in one window were allowed to keep running into the next one, so they could collect a recovery that happened months later, in data the setting was never supposed to see.

Both bugs flatter exactly one kind of idea: "hold longer". Fixed (mark open trades at the window end, close everything at the boundary), the idea lost money at every size: −$18, −$43, −$82.

Two other things that bit me on the selection side

  • Hindsight picking. An ATR-based stop beat my fixed stop when I chose the best multiple on the full history. Chosen walk-forward, it lost. Same on all 5 coins I trade.
  • One window can be the whole edge. A breakout entry on ETH was positive walk-forward in total, but nearly all of it came from a single quarter. I now count how many windows an idea wins, not just the sum.

And the scale problem: I ran over a million rule evaluations on ETH alone, so even with walk-forward some winners are just luck. Out of ~100 ideas, 2 survived.
All numbers are backtests with fees. Code and every report, the broken script included, are here if useful: https://github.com/zulfi011/z-bot


r/mltraders • • 8h ago

ScientificPaper my ml vol model was basically just vxn in a trench coat

Thumbnail
gallery
3 Upvotes

so i built a ridge regression to forecast nasdaq 5 day realised vol, using vxn, vix, 10 and 21 day realised vol and vix changes. plan was buy vol whenever it said vol was coming
tested it walk forward 2013-2025 against just vxn on its own and a basic HAR model. it smashed HAR but against vxn it was a coin flip, won 14 of 25 half years and dm p was 0.135. correlation with vxn was 0.91 so it was pretty much just copying it. HAR + VXN actually beat it with less inputs lol. and its biggest win was the 2020 crash, take that out and theres barely anything
then i checked if buying vol actually makes money. over 21 days it lost 8.9% on average and only won like 1 in 4 times, the vol premium just eats you. on days my model said buy it was even worse at -10.7%
only buying on the signal ended at -0.6 vs -20.4 buying every time, which sounds good until you realise doing nothing is 0. it just barely ever fired
didnt open the holdout cause it failed on dev
biggest lesson was test against the dumbest baseline you can before anything else. has anyone actually got a vol forecast that adds something over implied?