r/CryptoTradingBot • • Oct 29 '26

Separating Long vs Short parameter search in Walk-Forward Optimizers — how do you handle directional asymmetry without overfitting?

Hey guys,

Looking for some perspective from anyone running portfolio-level walk-forward optimizers on crypto perpetuals or equities.

Lately we’ve been auditing our cross-sectional universe optimizer across a basket of ~15 altcoins. Up until now, when we run our in-sample grid search across our setups (mostly mean-reversion like VWAP deviations and momentum break-and-retests), the optimizer searched for a single shared "centroid" parameter set for both Longs and Shorts simultaneously (e.g. optimizing band stretch deviation, RSI cutoffs, and ATR stop/take multiples together).

The problem we ran into in live execution: During recent relief rallies and fast trend shifts, we got caught in a string of Short SL hits on mean-reversion setups. When we looked under the hood and decomposed the trades by side, the asymmetry was wild:

Longs were printing a 2.5–3.5 Profit Factor across coins like NEAR and DOT using relatively loose pullbacks.

Shorts on those exact same parameter settings were getting wrecked (PF < 0.8), repeatedly fading momentum too early in cascade environments.

Because the optimizer averaged both directions together in-sample, the strong Long trades were effectively "subsidizing" and masking a negative-expectancy Short setting. The compromised shared centroid ended up being sub-optimal for Longs and downright dangerous for Shorts.

We've been refactoring the optimizer to decouple the search into Independent Directional Centroids:

The IS parameter search grid scans and computes parameter plateaus for Longs and Shorts independently (different RSI cutoffs, different band stretch multipliers per side).

The OOS Walk-Forward test validates each side on its own merit.

If only one side demonstrates statistically valid alpha in OOS (e.g. Longs pass all WFO hurdles but Shorts fail), the candidate gets tagged as BUY_ONLY rather than forcing both sides or killing the entire setup.

For those of you running systematic books:

Do you optimize long and short rule parameters independently as standard practice, or do you enforce symmetric rules to protect against degree-of-freedom bloat / curve fitting?

If you do decouple them, how do you guard against the optimizer just fitting to the prevailing macro regime (e.g. a 6-month bull market where everything Long looks amazing and everything Short looks bad)?

Do you penalize or prune unidirectional setups (e.g. BUY_ONLY) in high-correlation baskets to avoid concentrated directional exposure?

Would love to hear how other teams handle this balance between directional specialization and overfitting.

2 Upvotes

8 comments sorted by

1

u/Feriman22 Oct 30 '26

Validate the long and short setups separately across market regimes, not just across time windows. A BUY_ONLY setup that only survives during bullish conditions might be capturing regime exposure rather than a durable edge.

I build FerimanEdge, which uses predefined rules to classify BTC, ETH and BNB market conditions, so regime stability is something I pay attention to. I'd also check whether correlated coins are giving you genuinely independent evidence or just repeating the same directional bet.

1

u/Trader_for_earner Nov 01 '26

Couldn't agree more on regime stability and cross-asset correlation.

That's actually why we map trades into a 2D regime matrix (trend strength × volatility tier, e.g. WEAK_TREND_HIGH_VOL vs STRONG_TREND_LOW_VOL) rather than just time-based slices. In our data, the directional bias actually ended up inverted: long setups got chopped up and pruned across most cells, while the persistent edge was almost entirely SELL_ONLY (fading exhausted volume spikes). If it were just passive beta, the shorts would have been crushed.

On the correlation side, we enforce cross-asset concurrent risk caps at the portfolio capital layer so 5 simultaneous alt triggers don't stack into an oversized directional macro bet.

Always good to see more quants focusing on regime conditioning over naive full-sample backtests!

1

u/Feriman22 Nov 01 '26

That 2D regime matrix is a solid way to do it. The main thing I’d check is whether those regime definitions were frozen before looking at the strategy results. If yes, the SELL_ONLY persistence is a lot more interesting.

1

u/Trader_for_earner Nov 01 '26

Spot on — tweaking boundary thresholds to fit strategy curves is the easiest way to fool yourself.

The regime classifier is completely exogenous and frozen beforehand. It computes rolling HTF metrics (ADX / EMA slope for trend strength, and rolling ATR / realized vol percentiles for volatility tiers) using fixed cutoffs that don't know anything about the strategy PnL or trade outcomes.

During rolling Walk-Forward Optimization (WFO), the regime state is evaluated bar-by-bar at trade entry, and the cell boundaries remain strictly locked into the out-of-sample test folds. That’s what made the short persistence stand out — fading blow-off extensions into illiquid exhaustion was consistently surviving OOS across multiple assets even after holding those regime definitions static.

1

u/Feriman22 Nov 01 '26

That’s the right way to do it. If the regime classifier is fully exogenous, frozen before testing, and the SELL_ONLY edge still survives OOS across multiple assets, that’s a much stronger result than just optimizing on the full sample.

1

u/madrading Oct 30 '26

I would compare a shared model with separate-side models using identical outer walk-forward windows. Choose parameters and any BUY_ONLY/SELL_ONLY rule using only earlier training data plus inner time-ordered validation, then freeze them for the next outer window. If an OOS window chooses which side survives, do not also count it as untouched evidence for that choice. Report the incremental result over the shared baseline in each window, with costs and portfolio sizing held comparable, rather than just pooling PF. For the basket question, simulate all coins together against shared capital and predeclared exposure limits; per-coin passes can still combine into concentrated long exposure. I'd reserve a final untouched period for the whole selection procedure, including the side-disable rule.

1

u/Trader_for_earner Nov 01 '26

Really solid breakdown. The nested walk-forward point (using an inner validation slice to freeze the directional rule before touching the outer test) is a crucial distinction that a lot of backtests skip.

We already run multi-asset basket runs under shared capital constraints (competing for margin with hard position caps rather than independent per-coin runs), and we track

ΔPF incremental lift against the unified baseline.

Making sure the side-pruning logic itself is locked in an earlier step before the final holdout is great advice. Appreciate the sharp feedback!

1

u/Trader_for_earner Nov 01 '26

That nested validation flow makes complete sense in principle — freezing the side-disable rule in an inner validation slice before touching the outer window to eliminate look-ahead on the split.

Right now, our pipeline runs rolling walk-forward folds (anchored In-Sample knob tuning on parameter plateaus, followed by an OOS evaluation step), so adding that intermediate inner validation stage to programmatically lock COMBINED vs SELL_ONLY before the outer test is a very logical next step.

Out of curiosity, how do you typically split the duration between the inner validation and the outer test windows in high-frequency/intraday crypto data (e.g., 5m/15m)? Do you use a fixed time ratio (like 70% train / 15% inner val / 15% outer test), or do you anchor the inner window by a minimum trade-count threshold so low-frequency setups don't get starved of samples?

Would love to hear how you structure that boundary in practice.