Unbroke Signal Grader (kNN)

374
In simple terms: what it does and how to use it
  1. Add it to your chart. It marks two simple signals: T (trend: price breaks above its recent high while the trend is rising, or the mirror for shorts) and R (reversal: RSI, a common momentum gauge, turns back up from low or down from high).
  2. Each signal gets a grade from 1 to 4. The grade is simply the share of the 15 most similar past signals on this chart that worked out (moved 1 ATR its way first; ATR = the average size of a recent candle). 4 means most similar past signals worked, 1 means few did. Until there are 30 finished past signals, you see a dash.
  3. Read the top line of the panel. It tells you whether high grades actually did better than low grades on your chart so far.
  4. Be honest with yourself: in our own tests high grades did not win more often than low grades. Use it to check that idea on your own chart, not as a buy or sell signal.

T and R labels are the two simple signals, and the number on each is its grade from 1 to 4. Read the panel's top line first: it says whether higher grades actually did better than lower grades on this chart so far.

Unbroke Signal Grader (kNN) is a self-check tool.

A similarity count, not a forecast or a signal. This tool lets you check, on your own chart, whether grading signals by "how did similar past setups play out" tells you anything at all. In our own tests it did not.

What it does
It marks two simple, open signals: a trend signal (T) when price closes above the last 20-bar high while the 50 EMA is rising (mirror for shorts), and a reversal signal (R) when RSI(14) closes back above 30 or back below 70. Each signal gets a grade from 1 to 4: the share of its 15 most similar finished past signals (same type, this chart) that won. 4 = 75% or more, 3 = 50-74%, 2 = 25-49%, 1 = under 25%. A "win" means price moved 1 ATR its way before 1 ATR against within 24 bars (both on one bar or a time out = loss). Until 30 past signals of the same type have finished, new signals show a dash.

What our tests found
We tested NQ and ES (1h, 15m, 5m) and BTC (1h, 15m), using the first 70% of data as "dev" and holding back the last 30% as "holdout". That is 16 checks. In plain words: high grades (3-4) did not win more often than low grades (1-2) beyond what chance explains.
- Win % difference, grades 3-4 minus grades 1-2 (signals in each group):
NQ 1h: dev -5.9 pts (433 / 430), holdout +4.5 (200 / 221)
NQ 15m: dev +1.8 (116 / 124), holdout -1.8 (71 / 64)
NQ 5m: dev +2.6 (438 / 383), holdout +10.9 (171 / 227)
ES 1h: dev +5.1 (426 / 478), holdout -2.6 (205 / 175)
ES 15m: dev +8.9 (73 / 157), holdout -3.0 (47 / 77)
ES 5m: dev +2.2 (210 / 545), holdout -2.5 (181 / 206)
BTC 1h: dev +2.2 (1617 / 2418), holdout +1.0 (796 / 1170)
BTC 15m: dev +3.1 (6570 / 8756), holdout -1.1 (3352 / 4315)
- After correcting for overlapping trades and for running 16 checks, only BTC 15m dev held up (+3.1 pts, small), and it reversed to -1.1 pts on the held-back data. NQ 5m holdout (+10.9) looked good alone but not after the correction.
- As a probability, the grade's raw share scored worse than simply using the running average win % in all 16 checks (Brier skill score below 0 in every one, from -0.012 to -0.129).
- Data: NQ and ES 1h Jun 2024 to Oct 2026 (about 2.4 years); NQ and ES 15m and 5m about 60-70 days (Aug to Oct 2026); BTC 1h and 15m Jan 2018 to Oct 2026. Full details in our results.

So treat grades as noise unless your own chart shows otherwise, and even then, read the panel as "so far", not a forecast.

How to read the panel
The top line is the verdict for your chart and is always shown. It compares grade 3-4 signals with grade 1-2 signals on finished trades only, using a 95% range that treats each 24-bar block as one unit (because trades overlap). It prints one of:
- "Too few closed signals to judge (need 30 in each group)."
- "No difference between grades so far. Treat grades as noise here."
- "Higher grades did better so far. Could be chance; not a forecast."
- "Grades on this chart: higher grades did worse so far."
If a group has under 100 signals, the verdict starts with "Preview (under 100 in a group): ".
Below that: win % per grade next to seeded random entries on the same chart, so you can see if any grade is "Above random" (better than random bars). Grades use one blue at different strengths, so nothing reads as buy or avoid. Each signal keeps the grade it got when it fired.

How we checked for cheating (look-ahead)
An independent review by our research team checked that: everything runs on confirmed (closed) bars only; there is no request.security and no future data; a past signal is used as a neighbor only after its full 24-bar outcome window has closed; grades are fixed at the signal bar and never repaint (cutting the data short gave identical grades); scrambling the outcomes left grades with no difference, as it should; and a planted "cheat" feature was caught every time, which shows the test can see real separation when it exists. The review passed the Python reference.

CODE MATCH
TradingView version matched our Python test code on 100% of graded signals (BTC 373, ETH 361; Binance 15m, Sep 1 to Oct 26, 2026). Parts that only run on futures charts were checked by reading the code, not by a live match.

Forward test: settings are frozen and scoring starts on new bars from 2026-10-27 (NQ 5m, ES 5m, BTC 15m), with a check on 2026-12-21. The result gets reported either way, pass or fail.

Inputs
- Signals: trend on/off, reversal on/off, breakout lookback (20).
- Grading: neighbors k (15), memory (500 signals), signals needed before grading (30), feature window (300 bars), outcome horizon (24 bars), show labels from grade, show ungraded signals.
- Panel: position, offset, detailed panel (adds trend vs reversal rows and settings), text size, random entry rate and seed.
- Display: theme, trend line and cloud (context only, not part of the grade), glow, label size.
- Match check: a diagnostic for our Pine vs Python match, off by default; you can ignore it.

Alert
One alert only: "Any new signal". It fires at bar close, with the grade shown on the label. There are no grade-filtered alerts on purpose.

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

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.