Dualperiodfilter
- Indicators
-
Shi Yuan Wang
I write custom indicators, Expert Advisors (EAs), scripts and trading tools
for MetaTrader 4 and MetaTrader 5, and indicators for TradingView (Pine Script).
What I can do for you:
- Convert a clearly described trading rule into a backtestable MQL4/MQL5 EA - Version: 1.10
Dual Period Filter — Adaptive Dual-Period Coppock Momentum Indicator
In one sentence: A trend-strength visualization indicator based on dual-period ROC summation, adaptive source filtering, and a 4-state momentum histogram, running in a separate MT5 window.
How It Works
The classic Coppock curve sums a long and a short Rate of Change (ROC) and then smooths the result with a WMA. This indicator enhances the classic formula in two ways:
- Adaptive source filtering: Before the price is fed into the ROC calculation, it passes through an optional pre-filter (SMA / EMA / RMA / Double WMA / Triple VWMA / HMA / LLAMA / Kalman) to reduce noise, making the ROC sensitivity configurable.
- 4-state histogram: Based on whether the Coppock curve is above/below the zero axis and whether it is rising/falling compared to the previous bar, momentum is divided into strong bullish / weak bullish / weak bearish / strong bearish — four color states that let you spot changes in trend strength at a glance.
Key Features
- Coppock main line — colored by direction (bullish / bearish / neutral gray)
- 4-state histogram — two intensity levels on each side of the zero axis, four colors in total
- Zero-line cross arrows — a bullish arrow below the zero line on upward cross; a bearish arrow above on downward cross
- Zero reference line — rendered as a dashed level
Input Parameters
Parameter | Description | Default |
|---|---|---|
Source price | Price used for filtering | Close |
Long ROC length | Long-period ROC length | 14 |
Short ROC length | Short-period ROC length | 11 |
WMA length | WMA smoothing length for the Coppock curve | 10 |
Adaptive filter | Pre-filter type (None/SMA/EMA/RMA/DWMA/TVWMA/HMA/LLAMA/Kalman) | EMA |
Adaptive length | Pre-filter length | 20 |
Show Line / Histogram / Signals | Display toggles for the three plot groups | All enabled |
Signal offset | Arrow distance from the zero line | 0.2 |
Use Cases
- Trend confirmation: Main line above zero in bullish color = uptrend; vice versa for downtrend
- Momentum shift warning: Histogram changing from "strong bullish" to "weak bullish" signals fading trend energy
- Zero-line cross: Reference for potential trend direction change (the indicator does not place orders — use it alongside your trading system)
Usage Notes
💡 This indicator is a pure technical analysis tool for visualizing market momentum. It does not constitute trading advice. Always apply proper risk management and combine with other analytical tools.
On different symbols and timeframes, the ROC lengths and adaptive filter type may need tuning for optimal visual effect. Observe its behavior on historical data in the Strategy Tester before using it for live analysis.
