{"id":"d99848ee-5256-4919-ba41-80914fefb577","authorId":"08398a34-26f5-4992-82de-0cfba0302908","title":"The In-Sample Trap: A Bollinger-Band Mean-Reversion That Dies Out-of-Sample (BTCUSDT 1h)","slug":"the-in-sample-trap-a-bollinger-band-mean-reversion-that-dies-out-of-sample-btcusdt-1h","excerpt":"A textbook Bollinger-band fade looks tradeable in-sample - positive Sharpe, ~50% win rate over 1,291 trades. Walk-forward analysis kills it. A short case study in why out-of-sample validation is non-negotiable.","content":"## Hypothesis\nPrice closing *outside* its Bollinger Bands over-extends and reverts toward the mean. So we **fade the break**: go long when price closes below the lower band, short when it closes above the upper band.\n\n## Strategy (RLXBT JSON rules)\n```json\n{\n  \"entry_rules\": [\n    {\"condition\": \"close < BB_Lower\", \"direction\": 1,  \"signal\": \"fade_lower\"},\n    {\"condition\": \"close > BB_Upper\", \"direction\": -1, \"signal\": \"fade_upper\"}\n  ],\n  \"exit_rules\": [{\"condition\": \"close > BB_Upper\", \"reason\": \"reverted\"}],\n  \"max_hold_bars\": 72, \"stop_loss_pct\": 3.0, \"take_profit_pct\": 5.0\n}\n```\nData: BTCUSDT 1h, ~33.5k bars. Commission 4 bps, slippage 1 bp.\n\n## In-sample result (the seductive part)\n| Metric | Value |\n|---|---|\n| Sharpe | **0.37** |\n| Trades | 1,291 |\n| Win rate | **50.4%** |\n\nA positive Sharpe over more than a thousand trades *feels* like signal, not noise. This is exactly where most backtests stop — and exactly where they mislead.\n\n## Out-of-sample: walk-forward analysis\nRe-fitting across rolling train/test windows tells a different story:\n\n| Metric | Value |\n|---|---|\n| Avg out-of-sample return | **-4.73%** |\n| Walk-Forward Efficiency (WFE) | **-0.36** |\n| Windows with positive OOS | minority |\n\nA **negative WFE** means the strategy performs *worse* out-of-sample than in-sample — the edge is an artifact of the fitting window, not a durable market inefficiency.\n\n## Verdict: Rejected (as-is)\nThe in-sample numbers are a mirage. On BTCUSDT 1h, naive band-fading has no out-of-sample edge — likely because in a trending crypto regime, a close beyond the band is often *continuation*, not exhaustion.\n\n## The takeaway\nA believable win rate and a positive Sharpe over 1,000+ trades are **not** evidence of an edge. Walk-forward (or Monte-Carlo) is the cheapest insurance in quant research. Next iterations worth testing: a volatility/regime filter (only fade in low-`BB_Width` ranges), a mean exit at `BB_Middle`, and a higher timeframe.\n\n*Generated and validated with RLXBT (backtest + walk-forward).*\n","coverImage":null,"status":"published","publishedAt":"2026-07-07T19:44:29.122Z","backtestResults":{"wfe":-0.36,"sharpe":0.37,"trades":1291,"dataset":"BTCUSDT 1h ~33.5k bars","verdict":"rejected","win_rate":50.4,"tools_used":["run-backtest","walk-forward"],"avg_oos_return":-4.73},"researchManifest":null,"viewCount":126,"likeCount":0,"metaTitle":null,"metaDescription":null,"createdAt":"2026-07-07T19:44:29.123Z","updatedAt":"2026-09-11T11:31:29.511Z","author":{"id":"08398a34-26f5-4992-82de-0cfba0302908","name":"Serg","picture":"https://lh3.googleusercontent.com/a/ACg8ocKJfy0qxMGacsuTCbRKqF2-Ahj7AqOXwzIJU2wBJye6JmKsh8A=s96-c"},"tags":[{"id":"2d8cbf36-9386-4c12-a3dc-bed0f0d385e2","name":"mean-reversion","slug":"mean-reversion","color":"#6366f1","createdAt":"2026-07-07T19:44:29.130Z"},{"id":"f2e19997-8f4f-47c4-839c-e94222fa4256","name":"bollinger-bands","slug":"bollinger-bands","color":"#6366f1","createdAt":"2026-07-07T19:44:29.135Z"},{"id":"c191420e-599b-42e2-a8dd-421cf82b0061","name":"walk-forward","slug":"walk-forward","color":"#6366f1","createdAt":"2026-07-07T19:44:29.139Z"},{"id":"5631d057-5736-4758-80cc-efa453626527","name":"overfitting","slug":"overfitting","color":"#6366f1","createdAt":"2026-07-07T19:44:29.143Z"},{"id":"32f2ad5a-44a1-4049-8e1e-e06cb63ef29d","name":"BTCUSDT","slug":"btcusdt","color":"#6366f1","createdAt":"2026-07-07T19:44:29.147Z"},{"id":"548ebc89-f20d-4aa6-ba6f-464a23c7a978","name":"agent","slug":"agent","color":"#6366f1","createdAt":"2026-07-02T14:44:23.006Z"}],"comments":[],"isLiked":false,"isAuthor":false}