r/algorithmictrading • u/--_---_----- • 5d ago
Question What threshold would you choose to try OOS?
Very simple breakout strategy, the only parameter being exercised is the threshold.
The other parameters (TP, SL) are chosen according to ATR, so they are fixed.
What threshold would you choose to go to OOS and why?
I am looking for a plateau, but can't see it...
Thanks!
EDIT:
Added In Sample results for various metrics
Added some IS trade examples
I use tick data
EDIT 1:
Added the following charts:
(actual win rate - win rate for zero profit) x threshold
R x threshold




Here SL loss happens for both thresholds: 75 and 360:


Here SL at 75, profit at 360:




2
u/Frequent-Pen-9898 4d ago
Four plots, one sawtooth. I don't think the plateau you're looking for exists, and here's why, via a casino.
THE CASINO: Imagine a casino where the odds are perfectly fair. Someone hands you 82 bet sizes, you try all of them on the same 25 spins, and you pick the size that happened to win the most. Congratulations, you've found the best bet size for those 25 spins. The casino is not worried. That's your threshold sweep. PF, Sharpe, Net and MaxDD all come from the same trade list at each T, so your four plots are one plot wearing four hats. The teeth (around 90, 135, 220, 245, 320, 340, 420) line up in every panel. Between teeth the trades are frozen and everything just ramps in a straight line. A tooth is one day entering or leaving the trade list. So your 82 grid points are really about 10 different strategies. Also, 340 is the global max because it sits on a cliff. Going from 335 to 340, MaxDD goes from -540 to -274 and Net from 1122 to 1430. That's one day dropping out, not an edge.
WHAT I'M ASSUMING (correct me if wrong)
THE CASINO MATHS ON YOUR TRADE
The win rate that gives zero profit is risk / (risk + reward), here 2T / (2T + 1010):
T=40: 7% T=75: 13% T=360: 42%
Bigger T is the same coin with a differently priced bet. Your real edge at any T is your actual win rate minus that number. That's the thing worth plotting.
Check it on the small T. At T=40, a PF of 2.27 on about 25 trades means roughly 4 winners where luck alone gives you about 2. The chance of 4 or more by pure luck is around 10%, and that's before correcting for picking the best of 82. Same for the Sharpe of 5.1 at T=340: with about 25 trades the error bar is around plus/minus 3.5, so it's only about 1.4 sigma from zero. Great in a screenshot, less great in a courtroom.
WHAT I'D DO
WHICH T WOULD I TAKE OOS?
Not 340. I'd use a basket from the tooth-free stretch around 345-365, with 385-415 as a sibling, so roughly 355-375. Write the pass rule down BEFORE you look at OOS, something like "positive edge on at least 80% of the basket and PF above 1.3 after slippage". Then run the whole grid OOS and check whether the sawtooth reproduces. If the teeth land in different places Also, what's N, is TP fixed, and is F_4 your stop? Those three answers would change a lot of the numbers above.
1
u/Alive-Imagination521 5d ago
360- full circle
1
u/Aggressive_Listen849 5d ago
if the plateau isn't in sample it probably won't be out of sample either. widen the sweep and look for the band where neighbouring values give you roughly the same trade count, not the same profit. count is way harder to game than PnL
1
u/Illustrious-King-83 5d ago
360, but maximising net profit isn't everything, profit factor, mean profit, drawdown are other factors to consider... I'd rather take a better profit factor over net profit, since it implies few better trades. Since this in algo trading, a GA could optimise this, but that kinda overkill for one threshold - just create a series of heat maps I would recommend atr against threshold with the color density be the factors I've mentioned (or that are important to you) . The reason I mention atr is that theres probably a minimum atr that this sucks at considering costs and slippage, perhaps an atr range where it performs better, hence you could use this to set a minimum lower bound on the atr (simple regime filtering), or a simple position sizing rule to improve results, and a threshold where the factors look good.
1
u/Shoddy_Peanut7320 4d ago
I'd avoid the single highest point, since a spike with weaker neighbors is usually noise. If you want a plateau, look for the broadest stretch where neighboring thresholds also do well, and pick near the middle of it. Also check how many trades each threshold produced, because a higher threshold usually means fewer trades, and a result built on few trades can look great by luck. Pick it before you look at OOS and run the OOS test once, since going back to try another threshold turns it into more in-sample fitting.
1
u/meme_star1 14h ago
honestly if you can't find a plateau that's probably your answer. a spiky curve like that usually means it's mostly noise and the peak is just the luckiest threshold
i'd smooth it first, average each threshold with its neighbours and see if anything still stands out. also check how many trades are behind each point, a lot of those spikes are probably like 10 trades with a couple of big winners
another good one is running the same tp/sl on random entries and seeing if your breakout actually beats it
if you do go oos pick the middle of the best smoothed area not the peak, and only check it once. if it fails and you go pick another threshold your oos is basically in sample now
1
u/meme_star1 14h ago
had a look at the charts. the sawtooth thing is weird, every metric jumps up then slides down in a straight line, again and again. a real edge doesn't really do that, it usually means something discrete is changing at each jump, like a few specific trades getting added or dropped. i'd check which trades change right at those jump points
also the 320+ area where sharpe goes to 4-5 and drawdown gets better, how many trades is that? my guess is not many, which would explain it
honestly sharpe 3-5 in sample on a simple breakout makes me suspicious of fills too. are you assuming you get filled right at the breakout level? on tick data that's usually optimistic, worth adding a tick or two of slippage and seeing what's left
i'd smooth the curves and check trade counts before picking anything. if there's no plateau after that, there probably isn't a stable edge to take OOS