AI Slop Holy Grail Trap - BTC 1H Non-Repainting Overfit — Strategy by OptiNod

By OptiNod

Performance Metrics

Description

AI Slop Holy Grail Trap - BTCUSDT.P 1H Non-Repainting OverfitThis educational BTCUSDT.P 1H strategy demonstrates an AI-generated Holy Grail backtest trap. It does not run an AI model on the chart. AI was used during development to inspect historical candle structures, generate and mutate many candidate rule sets, and optimize backtest metrics through 2025. Data from 2026 was initially held out for out-of-sample evaluation. The central point is that AI can produce an exceptionally convincing backtest without relying on classic repainting mechanisms, while massive candidate generation and selection still make a lucky OOS survivor increasingly likely.━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Presenting a 7,079% AI Slop Backtest.This strategy is not intended to promise real-world profits. It is an educational experiment designed to demonstrate how a seemingly flawless and dangerous backtest can be generated without relying on classic repainting or lookahead leakage, simply by having an AI explore historical candle structures at massive scale to maximize performance metrics.Why is it Named "AI Slop"?The term "AI Slop" is used here intentionally as a warning label.I did not design this strategy's entry architecture based on market theory and then simply hand the coding over to an AI. Instead, what I defined were the scope of the experiment, the data windows, a strict ban on repainting, and the goal of maximizing backtest performance. The actual entry conditions, the combinations of candle structures, the detailed filters, the thresholds, and the majority of the sub-logics were independently generated by the AI based on historical data and backtest outcomes.What the human defined: BTCUSDT.P 1-hour timeframe, the in-sample exploration window through 2025, the 2026 validation window, the scope of available data, and the performance metrics to optimize.What the AI generated: Candle structure interpretations, combinations of HMA, ATR, RSI, volume, and wick ratios, entry logic modules, exception filters, decimal-level thresholds, the Pine Script code, and iterative mutations of candidate strategies.The goal given to the AI: Do not begin with a causal market hypothesis; simply maximize return, Profit Factor, win rate, and drawdown characteristics within the training window.Consequently, modules labeled L_PULL, S_REJECT, and L_MBT do not stem from a pre-defined list of independent trading hypotheses. They are conditions the AI discovered or assembled during the optimization process, which were then retroactively given human-friendly names such as pullbacks, rejections, breakouts, or oversold bounces.Each explanation sounds perfectly professional. However, the existence of a plausible narrative is entirely separate from whether the condition captures a persistent structural edge that will repeat in the future.In this experiment, "AI Slop" does not imply poor code quality. It means a strategy where mass generation and performance optimization came first, and a sophisticated trading narrative was retrofitted to the output afterward. It looks rich and advanced on the surface, but if the volume of generated candidates and the selection process remain hidden, the final strategy appears far more robust than the underlying evidence justifies.━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Backtest ResultsThis strategy demonstrates unrealistically beautiful performance on the BTCUSDT.P 1-hour chart.Total Period: 2019-09-14 00:00 to 2026-06-11 21:00Closed trades: 687Total net PnL: +707,910.10 USDTTotal net PnL (%): +7,079.10%Win rate: 68.70% (472 / 687)Profit factor: 5.092Average trade: +1,030.44 USDTLargest win: +22,636.94 USDTLargest loss: -9,138.87 USDTThe metrics above were re-aggregated using only the closing (exit) rows from the TradingView CSV export. Because an entry and an exit are recorded separately for the same trade number, only the Exit long and Exit short rows were used to avoid double-counting.The drawdown also appears remarkably low:Exit-to-Exit Basis: Approx. 22,037 USDT (3.01%)Adverse Excursion Adjusted Basis (approx.): Approx. 24,602 USDT (3.36%)While this does not exactly mirror the Max Drawdown calculation used by the TradingView Strategy Tester, the CSV data alone still shows a strikingly smooth equity curve.Performance by DirectionLong: 494 trades / +496,616.14 USDT / +4,966.16% / win rate 69.43% / PF 4.636 / average +1,005.30 USDTShort: 193 trades / +211,294.02 USDT / +2,112.94% / win rate 66.84% / PF 6.807 / average +1,094.79 USDTPerformance by Year2019: 32 trades / +1,497.51 USDT / +14.98% / win rate 59.4% / PF 2.932020: 107 trades / +12,753.69 USDT / +127.54% / win rate 64.5% / PF 6.982021: 114 trades / +60,499.30 USDT / +604.99% / win rate 77.2% / PF 8.742022: 103 trades / +52,536.03 USDT / +525.36% / win rate 70.9% / PF 5.062023: 84 trades / +64,018.94 USDT / +640.19% / win rate 61.9% / PF 3.762024: 93 trades / +163,607.43 USDT / +1,636.07% / win rate 72.0% / PF 5.772025: 95 trades / +233,378.48 USDT / +2,333.78% / win rate 69.5% / PF 7.382026: 59 trades / +119,618.78 USDT / +1,196.19% / win rate 64.4% / PF 3.17Looking at these numbers alone, it resembles a flawless, production-ready strategy: positive results in every calendar year, balanced long/short performance, a high Profit Factor, low MDD, and stellar recent performance. That apparent perfection is exactly where the danger of this example lies.━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━How This Differs From Typical RepaintingTraditional repainting problems arise when information that was not yet available while a historical bar was forming is later assigned to that bar's calculations. A common example is the misuse of request.security() with unconfirmed higher-timeframe values, or the use of barmerge.lookahead_on in a way that injects later-confirmed information into earlier signals. The function request.security() is not inherently repainting; the problem is how unavailable or unconfirmed values are handled. These mistakes can produce flawless historical signals that could not have been reproduced in real time.In the past, suspiciously strong TradingView results were often dismissed by finding one of these recognizable implementation flaws. A reviewer could inspect the script, identify higher-timeframe leakage or lookahead behavior, and explain why the historical performance was invalid.This script does not use request.security() to request higher-timeframe data, does not use lookahead leakage, and does not assign later-confirmed information to earlier bars. Each entry condition is calculated using the current bar and already closed historical bars. In that conventional sense, the strategy is non-repainting.The important shift is that classic repainting is no longer necessary to manufacture a Holy Grail-looking backtest. AI can generate and mutate a vast number of rules that obey ordinary non-repainting constraints, repeatedly combine candle structures and indicators, add exception filters, and retain only the variants with the most attractive historical metrics. The final signals can remain stable after a bar closes, yet the strategy can still be deeply overfit to the data and selection process.A repainting check asks whether a historical signal could have existed at that time. It does not ask whether the strategy was discovered through a statistically valid research process.That is the main warning of this experiment. Previously, an impossibly smooth equity curve often invited the question, "Where is the request.security() or lookahead trick?" Today, finding neither is not enough. A strategy can pass conventional repainting checks and still be shaped into an apparent Holy Grail through AI-driven data snooping, multiple testing, candidate selection, and overfitting.Therefore, the absence of repainting does not mean the absence of backtest manufacturing or over-optimization.The Scale of AI-Driven Over-OptimizationWhen humans build strategies manually, conceiving ideas, writing code, interpreting results, and making adjustments requires significant time. With AI, the cost of this iteration loop plummets to near zero.An AI can endlessly mix and match dozens of features—RSI, HMA, ATR, volume, recent returns, close location within a range, body size, upper/lower wicks, and efficiency indices—to generate new conditions. Show it a losing period, and it adds an exception filter; let the trade count drop, and it creates a similar sub-rule; notice a low Profit Factor, and it slices thresholds into tighter fragments; see an uneven yearly curve, and it attaches yet another condition.Generating filters to dodge specific losing periodsScanning for precise thresholds to pump the Profit FactorInjecting exception rules to artificially suppress MDDCrafting sub-logics to salvage weak-performing yearsMutating existing logic parameters out to four decimal placesRetaining a massive pool of closely related high-performing candidates instead of evaluating a single pre-registered hypothesisRepeating this loop yields an enormous catalog of candidate strategies that all look fantastic on data through 2025, rather than a single cohesive system. Because the AI weaves a plausible-sounding narrative for each candidate, someone looking only at the final script can rarely tell it is the product of an exhaustive, brute-force search.━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━2025 In-Sample vs. 2026 Out-of-SampleThe data split for this experiment is structured as follows:In-Sample (IS): From 2019-09-14 to the end of 2025. This is the window where the AI generated conditions, filters, and parameters to build candidate strategies.Out-of-Sample (OOS): From 2026-01-01 to 2026-06-11. This is the window used to verify candidate performance outside the training data.The critical takeaway here is that I did not repeatedly tweak a single rule set to make it look good in 2026. The data through 2025 already offered an abundance of spectacular-looking candidates.If your pool of candidates is large enough, some of them will happen to align with the 2026 market regime purely by chance, not because they captured an enduring market truth. When you then select the candidate that performed best in 2026 as the final strategy, that 2026 window—originally intended as an OOS test—effectively becomes part of the selection set.Even if individual rules were not directly tuned on 2026, selecting one survivor from numerous candidates based on its 2026 result means the OOS data has already been consumed by the selection process.On the final public screen, only the single strategy that survived through 2026 remains visible. The countless candidates generated in the 2025 window, the failures that tanked in 2026, and the total number of attempts are completely hidden.Users unaware of this pipeline fall into a common trap:"2026 was an out-of-sample window not used in training, yet it performed phenomenally. This isn't curve-fitting; it's genuine alpha."But when mass candidate exploration is at play, a single successful OOS run is much weaker evidence than it seems. You must consider the high probability that you didn't predict 2026 accurately; you simply found a lucky survivor that happened to fit 2026.━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Footprints of Overfitting in the CodePine Script®pEff13Min = 0.1039pEff21Min = 0.0795pRangeWideAtr = 2.67pHotRsiMin = 70.78Values specified to four decimal places can hardly be considered universal laws of the Bitcoin market. In this experiment, they are custom-tailored values found by the AI to eke out maximum performance in a highly specific historical window.Parameter optimization itself is not inherently a sin. The problem arises when the volume of combinations tested, the number of iterations performed, the count of failed candidates, and how often the OOS data was recycled for candidate selection are left undisclosed.━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Core Features Exploited by the AIHMA 5/8/13/21/34/55/89: Layered representations of short-term momentum and long-term trend structures.ATR: Measuring the degree of price extension relative to current volatility.rangePos13/34/55: The relative positioning of the current close within recent ranges.eff13/eff21: Efficiency-style metrics reflecting directional movement versus noise ratio.ret6/12/21/34: Cumulative returns over the last N bars.volRel: The relative ratio of current volume compared to its 21-bar moving average.closePos, bodyPct, upperWick, lowerWick: Close placement, candle body percentage, and upper/lower wick lengths.macroBull, macroBear, trendUp, trendDn: Trend states mapped by combining HMA arrangements and slopes.━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Performance by Entry Logic & AI InterpretationsThe performance breakdowns below were re-aggregated using exclusively the exit rows from the TradingView CSV export.L_MBT / Long — 50 trades / win 64.0% / +103,043.17 USDT / PF 4.44 — Enters when the trend recovers via a strong bullish candle after an initial pullback near the median value.L_LOWM / Long — 55 trades / win 65.5% / +60,299.74 USDT / PF 3.89 — Enters upon the appearance of a lower wick backed by volume at the bottom of a trading range.L_PULL / Long — 20 trades / win 75.0% / +45,825.30 USDT / PF 20.12 — Enters on a breakout back above the HMA8 following an HMA13 correction within a strong uptrend.S_SLIDE / Short — 22 trades / win 59.1% / +32,283.10 USDT / PF 7.20 — Enters when a bounce within a markdown structure fails to clear the HMA8 and turns down.S_R21J / Short — 22 trades / win 77.3% / +31,157.66 USDT / PF 9.43 — Enters when an attempted breakout above the HMA21 fails and closes below it.S_PTOP / Short — 15 trades / win 46.7% / +30,178.01 USDT / PF 8.53 — Enters when momentum stalls at the top of a range following a sharp, overextended rally.L_OSNAP / Long — 50 trades / win 68.0% / +28,899.17 USDT / PF 4.07 — Enters on a technical bounce immediately following a sharp drop into RSI/Stochastic oversold territory.L_WASH / Long — 25 trades / win 76.0% / +27,196.47 USDT / PF 5.48 — Enters on a mild oversold bounce, provided the market is not in a macro downtrend.L_BDIP / Long — 14 trades / win 71.4% / +25,727.56 USDT / PF 12.49 — Buys deep bearish candle drops that leave the broader bullish structure intact.L_COIL / Long — 14 trades / win 50.0% / +23,674.30 USDT / PF 6.24 — Enters on a breakout above the prior 8-bar high following volatility compression in an uptrend.L_R21 / Long — 40 trades / win 70.0% / +20,673.83 USDT / PF 3.64 — Enters once short-term bearish pressure is overcome and price settles cleanly above the HMA21.S_BPAU / Short — 13 trades / win 69.2% / +19,265.63 USDT / PF 5.92 — Enters at the top of a bull trend when upward momentum stalls and upper wicks repeatedly print.L_DWASH / Long — 29 trades / win 65.5% / +18,099.15 USDT / PF 2.24 — Buys extreme overextended drawdowns pushed well below standard support zones.S_REJECT / Short — 13 trades / win 61.5% / +17,683.04 USDT / PF 27.66 — Enters when price rolls over after retesting the HMA34 within a broader downtrend.L_BACX / Long — 7 trades / win 85.7% / +17,345.37 USDT / PF 5.36 — Breakout buy entering on sustained trend acceleration even at historical highs.S_BMID / Short — 14 trades / win 64.3% / +15,567.38 USDT / PF 3.64 — Trend-following entry when the downward momentum slope steepens again.S_NEDGE / Short — 18 trades / win 61.1% / +15,203.18 USDT / PF 3.66 — Enters when an attempted breakout above the upper bound of a neutral range falls flat.L_NLR / Long — 4 trades / win 75.0% / +14,411.49 USDT / PF 9.58 — Buys a lower wick at range support coupled with an exit from RSI oversold territory.L_HOTC / Long — 23 trades / win 82.6% / +13,568.77 USDT / PF 5.00 — Momentum-following buy entering as strong price action rides the upper overbought bands.L_H21R / Long — 19 trades / win 57.9% / +12,762.42 USDT / PF 4.00 — Enters as price holds above the HMA13 after resetting its HMA21 baseline.L_BREAK / Long — 27 trades / win 66.7% / +12,225.54 USDT / PF 2.87 — Breakout buy entering on a breach of the 8-bar high with massive volume and a wide-bodied candle.L_QCONT / Long — 12 trades / win 75.0% / +11,103.10 USDT / PF 9.09 — Enters on a quiet, steady drift upward amid low market volatility.L_LOWD2 / Long — 7 trades / win 85.7% / +11,027.46 USDT / PF 5.01 — Enters below a support level where selling pressure is absorbed on high volume.L_D21R / Long — 25 trades / win 84.0% / +10,851.71 USDT / PF 15.92 — Enters on a forceful breakout above the HMA21 following a healthy 21-bar correction.S_BRELIEF / Short — 11 trades / win 72.7% / +10,373.45 USDT / PF 21.27 — Enters when a dead-cat bounce in a bearish structure fails to pierce overhead resistance.L_C21C / Long — 27 trades / win 63.0% / +10,005.92 USDT / PF 2.51 — Enters on a bullish flip after confirming HMA21 support within a tightening consolidation.S_FLUSH / Short — 13 trades / win 61.5% / +9,821.10 USDT / PF 11.19 — Enters on a breakdown below the prior 8-bar low accompanied by a surge in volume.L_MCOIL / Long — 8 trades / win 75.0% / +9,728.07 USDT / PF 10.02 — Enters on an upward reversal following a drop in efficiency near fair value.S_G1T / Short — 4 trades / win 100.0% / +8,183.22 USDT / PF 9999 — Scalps a short trend-continuation trade when bounces are practically non-existent in a fierce selloff.S_AFAIL / Short — 8 trades / win 62.5% / +7,250.62 USDT / PF 9.03 — Enters when a breakout above a previous swing high fails at the top of a choppy range.L_H13C / Long — 21 trades / win 71.4% / +7,043.40 USDT / PF 3.49 — Enters on a swift recovery after clipping the HMA13 during a moving-average compression.L_TAILQ / Long — 8 trades / win 87.5% / +6,617.40 USDT / PF 5.83 — Enters where lower wicks are repeatedly absorbed at specific lower boundaries of a downtrend.L_VPIV / Long — 9 trades / win 55.6% / +6,486.80 USDT / PF 4.03 — Enters on a high-volume reversal candle printing near a major range bottom.S_SHELF / Short — 14 trades / win 71.4% / +5,814.77 USDT / PF 4.02 — Enters short as the floor of a long-term horizontal support shelf completely disintegrates.S_RUP / Short — 14 trades / win 71.4% / +5,801.93 USDT / PF 3.13 — Enters short after a vertical spike when volume dries up and buying liquidity instantly vanishes.S_BCLX / Short — 4 trades / win 75.0% / +1,806.69 USDT / PF 15.72 — Enters short following a buying climax when price fails to sustain a push into the upper boundary of a high-altitude range.S_HIRANGE / Short — 8 trades / win 87.5% / +904.24 USDT / PF 6.89 — Enters short at a range top as upward momentum evaporates on anemic volume.Entry modules with very small sample sizes should not be treated as statistically meaningful.For example, S_G1T's Profit Factor of 9999 is not evidence of a superior structural setup. It is a mathematical artifact caused by having only 4 trades and no recorded losses.━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Scope of Use & WarningsThe primary asset under review is the BTCUSDT.P 1-hour chart.Robustness across other tickers or alternative timeframes has not been evaluated.This script does not execute machine learning models natively on your chart, nor does it learn dynamically in real-time. The AI was used strictly during development to generate the code and logic rules.The presented metrics are historical simulations produced by TradingView's broker emulator and the selected strategy settings, not actual account equity.Real-world results will vary with fees, slippage, order sizing, data-feed differences, latency, and fill assumptions.This strategy is not a turnkey solution for auto-trading or financial advice. It is a public educational experiment highlighting the vulnerabilities of AI-driven brute-force optimization and selection bias.━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ConclusionThis strategy is not a masterpiece forged from sophisticated market intuition. It is a pure backtest artifact produced by demanding high performance from an AI, which then aggressively mined historical candlestick structures to engineer a solution.The individual setups sound perfectly rational, the code entirely avoids traditional repainting traps, and it delivers astonishing performance across both the 2025 training window and the 2026 OOS period. Yet, none of this proves genuine alpha.AI can generate code structures, filters, thresholds, and sub-rules at speeds humans cannot match. When a massive surplus of candidates is produced within a training window, the chance that at least a few will appear to thrive in the subsequent window rises sharply. Disclosing only the final survivor can leave viewers with the impression that they are seeing a masterfully engineered system that captured future market dynamics from the beginning.This is precisely why this strategy bears the name "AI Slop."It represents an AI output that looks professional, robust, and mathematically flawless on the surface—but can be mistaken for far stronger evidence than it truly provides when the generation volume, historical iterations, discarded candidates, and selection filters remain invisible.Whether this result is merely a lucky survivor or reflects a real structural edge can only be tested by locking the rules permanently and evaluating the strategy on entirely fresh holdout data or real-time forward results that are completely detached from the selection pipeline.

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView