This channel is based on the Hodrick-Prescott filter, which is a type of zero-lag digital filter. First, filtered Close price values are calculated. Then, a second filtering with a longer period is applied. This results in two arrays: HP and HPSlow. In the next step, the standard deviation of HP relative to HPSlow is computed, and a channel is constructed.
The VHP channel PRT indicator displays the average spread value and the channel width relative to HPSlow (expressed as a percentage) at the zero bar, in the lower-right corner of the chart. You can double-click the text label to drag it to a convenient position. Pressing the DEL key will remove it. When switching timeframes, the text will reappear.
Compared to Moving Averages, such filters look visually appealing but redraw as new bars appear. Why Does This Happen? It's mathematically impossible to implement a truly “honest” zero-lag filter. Any filter introduces a delay equal to or greater than the averaging period. This becomes obvious when adjusting the period in a Moving Average: the longer the period, the smoother the result—but the greater the lag. There is only one way to eliminate lag: the input bars must first be filtered left to right, and then the resulting sequence must be filtered right to left. The initial direction doesn’t matter, as long as the second pass goes in the opposite direction.
In practice, zero-lag filters represent various trade-offs between smoothing and delay. However, it is crucial to understand that a perfect solution is unattainable, as the future cannot be predicted!
Recommended Use
This filter is best used to identify short-term price direction, especially within the last few bars. When this channel is overlaid with a Standard Deviation Channel, you'll notice that near the latest (rightmost) bars, both show similar directions. However, while the Standard Deviation Channel consists of three straight lines, this channel provides a more precise direction of price movement in history — albeit with decreasing accuracy the further back in time you go.
Implementation Notes
During the MQL4 adaptation, additional code was added to draw the channel "tails". Run it on the M1 timeframe, wait about 30 minutes without switching timeframes, and you’ll observe the channel “wagging its tail.” When switching timeframes, the tail disappears.
Use Case Recommendation
This indicator is best suited for scalping. It is not appropriate for long-term strategies,
Indicator Input Parameters:
HP Fast Period — HP filter period
HP Slow Period — HPSlow filter period
You can use this indicator in our versatile ProfRoboTrading Channel EA, in wich you can seamlessly integrate various channel, arrow, and reversal indicators. It offers the flexibility to use all popular channel trading strategies, while also providing powerful tools to customize your trading conditions and risk management system.
ProfRoboTrading Channel EA for MT4: