Dev.to WebDev 🛠 Dev 👁 0 📖 5 min read

Buying the dip without catching the knife: a 2-line crypto pullback rule, walk-forward validated across 40 coins

"Buy the dip" is the most repeated advice in crypto — and following it blindly is one of the most reliable ways to lose money. A 6% pullback inside a bull market and a 6% bleed on the way to zero print the same red candl

Buying the dip without catching the knife: a 2-line crypto pullback rule, walk-forward validated across 40 coins

"Buy the dip" is the most repeated advice in crypto — and following it blindly is one of the most reliable ways to lose money. A 6% pullback inside a bull market and a 6% bleed on the way to zero print the same red candle. One is an opportunity; the other is a knife.

We built Trend Dip, a pullback strategy that only buys reclaims inside an uptrend, validated it walk-forward across 40 coins on 4-hour bars, and shipped it as a free preset in our in-browser backtester — no signup, the whole engine is WASM running locally in your browser, so you can re-run every number in this post on any coin in about a second.

The rule (two lines)

ENTRY:CROSS(C,LOWER) && C>TRENDMA    // buy the reclaim of the lower Bollinger band, in an uptrend
EXIT:CROSS(C,MID)                    // sell at the mid band

…where LOWER = MA(C,20) − 2·STD(C,20), MID = MA(C,20), and TRENDMA = MA(C,100). Each piece earns its place:

  • C > MA100 — the trend filter. This is what separates a dip from a knife. Below the 100-bar average, the same band reclaim is ignored entirely.
  • CROSS(C, LOWER) — buy the reclaim, not the touch. The entry fires on the bar whose close comes back above the band. The market has already rejected the low once before you spend a cent. This single change moved the OOS win rate by roughly ten points versus buying the first touch.
  • Exit at the mid band. The thesis is snap-back to the 20-bar mean, so that's where the trade ends. We tried smarter exits — trailing lows, trend-break exits — every one performed worse out of sample.
  • No stop in the formula. Deliberate: 4h crypto charts routinely flush 5% below the band and revert by the next close, and a stop converts those wicks into realized losses. Adding a 10–20% protective stop changed the results almost imperceptibly (stops almost never fired). The backtester still gives you an optional stop field if you want a hard tail cap.

Trend Dip backtest page on BTC/USDT 4h — chart, formula, equity curve, stats grid and trade list

How we validated it

Four rules, all of which matter:

  1. Not one chart — forty. BTC, ETH, SOL, BNB, XRP, DOGE, AVAX, DOT and 32 more majors with long histories. A rule that only works on a cherry-picked chart is a screenshot, not an edge.
  2. Walk-forward, not full-history. Each coin's ~500 days of 4h bars split 70/30: the first 70% is where parameters would effectively have been chosen; the final 30% is scored blind as one continuous out-of-sample segment. All headline numbers below are OOS only.
  3. Realistic fills. Signals confirm at bar close, fill at the next bar's open — no lookahead — with 0.10% taker fee + 0.05% slippage per side (~0.3% round trip). The same engine and simulator that power the public backtest page ran every test.
  4. Benchmarks. The identical harness scored the nine other strategies on the site on the same data.

The numbers

Out-of-sample metric (40 coins, 4h, 70/30) Result
Win rate, all held-out trades 73.6% (174 trades)
Win rate, in-sample (for contrast) 62.9% (267 trades)
Coins profitable OOS 26 / 40
Coins beating buy & hold OOS 24 / 40
Coins winning ≥50% of held-out trades 33 / 35 with ≥3 trades
Median per-coin max drawdown −6.1%
Worst / median / best held-out trade −16.7% / +1.2% / +34.8%
Average holding time 12 bars ≈ 2 days
Win rate at 2× fees 69.5%
BTC / ETH / SOL win rate 83% / 75% / 100%

Two details deserve a second look. First, the OOS win rate is higher than the in-sample one — overfit strategies show the opposite signature: brilliant in the tuning window, collapsing the moment data is unfamiliar. Second, the edge survives fees at two to three times what a normal spot account pays.

Statistics grid and the full trade list for the BTC run

Trying hard to break it

  • Six consecutive time slices scored separately: win rates 71%, 56%, 62%, 55%, 69%, 75% — every window above 50%. A regime-dependent fluke does not do that.
  • Parameter plateau. Defaults (20 bars, 2σ, MA100) sit in the middle of a plateau: 1.8σ–2.5σ all won 70–77%, neighbouring trend filters (50–200) all stayed positive. If performance collapses when you nudge a parameter 10%, you found noise.
  • Split-date sensitivity. Moving the walk-forward cut across 50/30 → 90/10 changed the aggregate win rate only between 55% and 66%.
  • Exit shoot-outs. Adding a 10-bar-low emergency exit or a trend-break exit lowered the OOS win rate (61.5% and 51.0%). The boring mid-band exit won — stops were selling into the very wicks the strategy profits from reverting.
  • Benchmarks: the best of the nine existing strategies managed a 51% OOS win rate on the same data.

Where it loses — read this part

  • 73.6% win rate is not a money printer. The median winner is small (+1.2%) because the target — the mid band — is close. The profile is many small wins, occasional runners, occasional give-backs. The worst held-out trade lost 16.7%.
  • No formula stop means tail exposure exists. Historically the MA100 filter and mid-band exit capped the damage, but a coin that breaks down mid-trade holds until it recovers to the mid band. If that worries you, set the optional stop in the backtester and accept slightly worse expected numbers for a hard floor.
  • The held-out window is one market regime (~5 months per coin, dips inside an uptrend). In a full bear market the MA100 filter will simply keep the strategy flat for long stretches — designed behavior, not a bonus.
  • Survivorship bias is real — today's top-40 list excludes the coins that died.

Run it across the whole market

One coin's backtest is an anecdote. The scanner page runs the identical formula across a whole universe in one pass — each coin split walk-forward, ranked by out-of-sample Sharpe:

Multi-coin scanner running Trend Dip across the top-20 universe

Under the hood (the dev part)

The whole thing — formula parser, indicator engine, backtest simulator, walk-forward scanner — is a Rust→WASM module evaluated entirely in your browser on real exchange candles. The strategy DSL is a tiny TDX-style language (ENTRY:CROSS(C,LOWER) && C>TRENDMA;), so every rule on the site is user-editable text, and the simulator fills at the next bar's open with configurable fees and slippage. Nothing you type is uploaded anywhere.

  • Re-run this exact strategy on any pair: backtest page
  • Scan the whole universe: scanner page
  • Full write-up with more stress tests: original article (canonical URL of this post — it's the same article, cross-posted)

Disclaimer: everything above is a historical backtest, not a promise. Backtested win rates decay in live trading. Not financial advice — crypto is volatile and you can lose your entire investment.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.