Taught to Trade - Range Filter Audit

221
Range Filter Audit draws the price that would turn the Range Filter the other way, and counts how often its turns reverse. Same filter as the popular Range Filter scripts, with the turn level and an audit panel added.

CREDIT AND WHAT IS ORIGINAL
The Range Filter method is by DonovanWall. The guikroth 5min variant (Sampling Period 100, Multiplier 3), VuManChu Swing Free (20 / 3.5) and colinmck's Twin Range Filter (two ranges averaged) use the same filter. This script is written from scratch from the method; no code is reused. What is new here: the turn level drawn on the chart, closed-bar vs open-bar markers, the twin preset in one tool, and the audit panel.

HOW IT WORKS
r = EMA(EMA(|close - close[1]|, period), 2 x period - 1) x multiplier.
The filter line holds still unless price is more than r away from it. Above the line it moves to max(line, close - r); below it, to min(line, close + r).
A turn is the first bar where the line steps the other way and the close is on the new side (the same rule as the original labels; checked bar-for-bar against the original on 200,000 synthetic bars, zero differences).
Turn level = line - r while the filter is up (line + r while down). Because the line trails the highest close by r, that level sits about 2 x r below the highest close: the turn is a 2-range trailing stop on closes.

HOW TO USE IT
Read the turn level as "how far price must come back before the filter turns", not as a target.
Twin preset: choose "Twin (fast + slow averaged)" for colinmck's settings (27 x 1.6 and 55 x 2.0).
Panel: turns on closed bars, how many were reversed within N bars, average bars per turn, how often the line was flat, and live turns that disappeared when the bar closed.
Grey circles mark a turn on a bar that is still open. It can vanish before the close. Alerts set to "once per bar close" only fire on closed-bar turns.

WHERE IT FAILS
- A turn is a trailing stop, not a forecast. It prints after price has already come back about two ranges from its extreme close.
- It turns on noise too. On random-walk data with nothing to predict, the default settings still turned about every 35 bars, the twin preset about every 16 bars, with 18-19% of twin turns reversed within 5 bars.
- The range adapts slowly (199-bar smoothing at the defaults), so after a volatility change the level is too tight or too wide until the average catches up.
- The turn level uses the current r; the next bar's r is slightly different, so the drawn level is close to, not exactly, the trigger.
- Results depend on settings, symbol and timeframe. The counters describe this chart's history, not what will happen next.

This script is for education. It does not give buy or sell instructions, and nothing here is a claim about future results.

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.