Unbroke Reversal Signals + Kernel Bands

2 330
Unbroke Reversal Signals + Kernel Bands draws a smooth kernel line (Nadaraya-Watson style, Gaussian weights) with ATR bands, and marks reversals when price pokes outside a band and closes back inside.

Non-repainting: endpoint version only
Many kernel-envelope scripts redraw the whole line on every new bar, so past values change. This one does not. Each bar's value uses only that bar and older bars, and it never changes afterwards. The cost: the line lags more than the redrawing versions you may have seen.

How it works
  • Kernel: weighted average of the last 50 closes, weights exp(-i^2 / (2 x 8^2)).
  • Bands: kernel +/- 2 x ATR(50).
  • Bull reversal "R": the previous bar's low was below the lower band, and this bar closes back above it. Bear: the mirror at the upper band. Marked at bar close.
  • Line color follows the kernel's slope.


Stats panel (vs random entries)
Bottom left. Each signal is tested with one rule: did price move 1 ATR(14) in the signal's direction before it moved 1 ATR against, within 24 bars? Then it is compared with random bars on the same chart, scored the same way. "Beats random" needs a gap bigger than the noise range (95%). Fewer than 20 cases shows "Not enough data".

Honest results
We ran the same rules in a Python copy of the script on NQ futures 1-minute data (Dec 2022 to Dec 2025):
  • NQ 5m: random 48.0% (9,208). All reversals 48.2% (20,565). With kernel slope 46.0%. Kernel turns 48.7%. All inside noise.
  • NQ 15m: all rows inside noise (reversals 47.6% vs random 47.7%).

In this test the reversal marks did not beat random. Use the bands to see stretch from the mean, not as signals on their own. Your chart's numbers will differ because your chart loads a different amount of history.

Alerts
Bull reversal, bear reversal, kernel turn.

Original Pine Script v6 code by Unbroke, open-source under MPL 2.0.

Educational, not financial advice. Past results don't predict future results.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.