ที่อัปเดต:

Ehlers Roofing Filter [RC Tools]

150
RC Tools — Ehlers Roofing Filter
────────────────────────────────────────────────────────────────────

█ OVERVIEW

Price is three things layered on top of each other: a slow trend drift, a band of cyclical swings, and high-frequency noise. Most oscillators blur all three together. John Ehlers' Roofing Filter separates them. It removes the slow drift, then removes the bar-to-bar noise, and leaves only the middle band: the market's cyclical component, as a clean zero-centred oscillator.

█ WHAT IT DOES

Runs price through a two-pole high-pass filter (strips the trend) followed by a two-pole Super Smoother low-pass filter (strips the noise), then divides the result by its own recent root-mean-square so the reading is in comparable units on any asset. Classifies each confirmed bar into one of four phases — Positive & Rising, Positive & Fading, Negative & Falling, Negative & Recovering — colours the background accordingly, and shows a table with the current phase, how long it has lasted, the reading, and the active passband.

█ THE THEORY BEHIND IT

A standard oscillator such as RSI or a detrended price series still carries slow drift from the underlying trend, so its zero line or midline means different things at different times. A high-pass filter removes that drift by discarding cycles longer than a chosen cutoff. That alone leaves jagged, noisy output, so a low-pass Super Smoother, a two-pole filter that smooths with less lag than a simple moving average of similar length, removes cycles shorter than a second cutoff. What survives is a "passband" of cycle lengths: the swings long enough to matter and short enough not to be trend. In Ehlers' terminology, the filter's output "roofs" over both ends of the spectrum.

█ HOW IT IS CALCULATED

1. Two-pole high-pass filter on price, with a cutoff period of 48 bars by default (cycles longer than this are removed as drift).
2. Two-pole Super Smoother low-pass filter on the high-pass output, with a cutoff of 10 bars by default (cycles shorter than this are removed as noise).
3. Divide the filtered value by its own root-mean-square over a rolling window (100 bars by default) so the output is in comparable units.
4. Classify: above zero and higher than the previous confirmed bar = Positive & Rising; above zero and lower = Positive & Fading; below zero and lower = Negative & Falling; below zero and higher = Negative & Recovering.

State classification occurs ONLY on confirmed bar close. The plot, background and table update together on closed bars, so nothing flips mid-bar.

█ SETTINGS & CONFIGURATION

• Source (default close)
• High-Pass Cutoff (default 48 bars) — shorter removes trend more aggressively
• Low-Pass Cutoff (default 10 bars) — longer is smoother but slower. Capped just below the high-pass cutoff if set higher
• RMS Normalisation Window (default 100 bars)
• Table position, state colours, pane background and optional main-chart background tint are all configurable

█ HOW TO USE IT

Use it to see the market's cyclical rhythm without the trend in the way. Swings that stretch beyond roughly ±2 on the normalised scale are large relative to recent history. Phase changes, such as Positive & Rising turning into Positive & Fading, show momentum within the cycle shifting before the zero line is crossed. It works best as context alongside your own trend and entry process, not as a standalone signal. Because it removes the trend by design, it is a tool for judging where you are within a swing, not which way the larger trend is going.

Works on any asset and timeframe; tune the two cutoffs to the cycle lengths you trade.

█ LIMITATIONS

• It isolates a band of cycle lengths. It is not a trend indicator, and a long steady trend reads as close to zero by design.
• It is a filter, not a forecast. It is a smoothed view of what price has already done, with a small, unavoidable lag from the low-pass stage.
• Passband choice matters. The cutoffs decide which cycles survive, and there is no single correct pair for every asset or timeframe.
• Recursive filters need time to settle, so the plot starts only after a warm-up period; the earliest bars on a chart are not reliable.
• RMS normalisation makes readings comparable but relative to recent history, so the same absolute move reads smaller after a volatile stretch than after a quiet one.
• Four phases are a deliberate simplification of a continuous reality.
• All classification updates on confirmed bar close only. This script does NOT repaint.

█ DISCLAIMER

For educational and informational purposes only. Nothing here is financial advice. Past behaviour of any cyclical phase does not indicate future results. Trade at your own risk.
Release Note
Updated screenshot

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน