r/algotrading • u/AlgonikHQ • 3d ago
Strategy Question for the sub
on range-based strategies, do you use a minimum stop distance, say a fraction of ATR? And if you'd only add it after seeing a tiny-range day like Thanksgiving, how do you stop it becoming a curve fit?
6
Upvotes
2
u/drguid 2d ago
Time based stops. I couldn't get price based stops to improve returns. In most cases they reduce returns.
2
u/AureusAI 2d ago
I'd add it, but base it on the logic, not on Thanksgiving. A range that's a fraction of normal is basically a different market: thin liquidity, and the spread eats the stop. To keep it honest, pick the floor before you look at results (something like 0.3–0.5x the 20-day ATR), then rerun the backtest at a few nearby values. If the result barely moves, it's a safety rail. If only one exact value makes it work, you're fitting to a handful of days. Also worth counting how many trades the rule actually touches. If it's 5 trades in 3 years, it isn't changing your edge either way.
2
u/marekesz1 2d ago
Yeah, I floor it at a fraction of ATR picked before I looked at holiday sessions. Then check out of sample whether tiny-range days lose money across several years. If the floor only rescues Thanksgiving, you're fitting.
1
u/AlgonikHQ 2d ago
Update.
I ran the test you all helped shape, so here's how it came out.
Setup. the floor was fixed before running, based on volatility and costs, all known before entry.
I tested two versions against the original, widen the stop with size cut so risk stays the same, or skip the trade.
Same run at a tighter and a looser floor value. Design years only (2015–19), later data stays sealed.
Results, over 6,736 trades,
Verdict, a safety rail, not an edge. It removes a few bad tiny-range days and does no measurable harm, but the breakout still loses overall, so it doesn't revive anything.
It's logged as try 77 in the graveyard.
Thanks to everyone who weighed in.
1
u/djawlagml 2d ago edited 2d ago
Yes, but I'd try to derive the floor from something that isn't the data you're afraid of fitting. The useful decomposition is: minimum distance = the price distance at which the trade idea is already dead, plus the round-trip cost expressed in price. The cost part is a constraint rather than a parameter, and it's the part range strategies usually forget, because a compressed range squeezes the target as well as the stop, so the ratio degrades from the cost side before the stop is ever touched. If the floor is max(k x ATR, 2-3x round-trip cost, spread at the entry hour), then "ATR fraction" is the only free knob left and it's bounded from below by mechanics. The other half of the question is really about the shape of the change. A rule that only earns its keep on one observed day is a fit to that day no matter how you write it down; a rule that expresses the mechanism (range compression means the same price noise is a larger fraction of the range, so the stop must widen relative to the range, not shrink with it) can still be wrong but is at least falsifiable. The cheap test is a placebo: freeze the rule, then apply the identical rule across the sample sorted by daily range and look at how often it changes the outcome. If it also helps on mid-range days, the relationship is plausibly real. If it only helps in the low-range tail, the honest label is "this is the observation, not the signal", and the pre-registered expectation should be neutral everywhere else. One structural alternative that avoids the new parameter entirely: make the stop a continuous function of realized range (c times the max range of the last N bars), calibrate c before you look at the day that bothered you, and let that day be a test instead of an input. Time stops are worth trying for the same reason the other reply gives; on range entries the state that produced the signal expires on a clock, not at a price, so a time exit usually damages the rest of the grid far less than a price stop does.
1
u/Impressive-Belt-6842 2d ago
the part worth testing first is whether atr is even measuring the thing you are afraid of. a 20 day atr barely moves on one compressed session, so the floor derived from it stays wide on exactly the days you want filtered out. a shorter window reacts on the timescale of the event: atr over 3 to 5 sessions, or just the range of the previous two. then judge it by what it blocks, not by the equity curve. record how many of the last year's trades the floor would have refused. three trades means decoration, twenty means a rule, and the only question that matters is whether the refused ones had worse net r than the kept ones.
1
u/NiceJoJ 2d ago
I’d test three versions side by side: the original, one that widens the stop, and one that skips the trade when the original stop is too tight. Keep the planned dollar risk per trade the same by sizing down when you widen the stop. Then you can see whether those trades needed more room or were better skipped.
1
u/DojiOwl 2d ago
I tie the stop to a volatility measure rather than a fixed tick distance, so on a compressed session the stop shrinks with the range instead of staying wide. The mechanical part that matters is computing that measure on a rolling window that excludes the current bar, otherwise the tiny-range day leaks into its own stop.
1
u/NJ_Algo 2d ago
I'd anchor it to something you'd have known in advance, not to that day. A stop tighter than spread plus normal slippage isn't a real stop anyway, so a floor based on costs or a small ATR fraction is easy to justify. Then check that the whole backtest barely changes across a few nearby values. If the improvement mostly comes from one Thanksgiving-type day, it's a fit.
1
u/GuiltyView3898 2d ago
Adding the stop rule only after seeing the Thanksgiving day is exactly how it turns into a curve fit, even if the rule itself makes sense. What works for me: write the rule down first, then judge it only on a period you haven't looked at yet. When I picked rules on one year and checked them on the next, hit rates of 60-92% in-sample dropped to 35-65%.
Also worth testing any exit against a plain fixed hold. I tried 60 score-based exits and none of them beat simply holding a fixed number of days.
1
u/Impressive-Belt-6842 1d ago
fair split, and it changes the test for the widen branch. if the floor only widens the stop, lag does not matter, but then the question becomes whether the extra distance is paid for: count the trades whose stop got moved and check whether their net r improved by more than the risk added per trade. if it improves by less, the floor is buying room with expectancy. the skip branch is the one where the window length matters, and there the check you described is the cheapest one available.
1
u/Maleficent-Success-6 1h ago
I'd test the minimum stop distance with fixed position sizes first, then repeat with risk-based sizing. Otherwise it's hard to tell whether the improvement comes from better exits or simply taking smaller positions on narrow-range days.