RSI_TripleHull

Download script
Author: Copyright � 2006, Matt Kennel. Licensed GPL v2
RSI_TripleHull

This tool is designed to provide a clearer, smoother view of market momentum by filtering out the "noise" typically found in standard technical indicators. Instead of reacting erratically to every minor price fluctuation, it uses a sophisticated layering technique to identify the true direction and strength of a trend.

The Core Logic: Smoothing Through Layers

The script operates on two primary concepts: Velocity (the speed and direction of price movement) and Volatility (how much the price is swinging).

To achieve high-quality data, the script processes these two factors through a "Triple Hull" calculation. Think of this like a multi-stage filter:

  1. It calculates the raw movement of the market.
  2. It applies three successive layers of mathematical smoothing to that movement. Each layer acts as a sieve, catching minor inconsistencies while allowing the primary trend to remain visible.
  3. It repeats this exact three-layer smoothing process for the market's volatility.

The Final Output: Two Distinct Perspectives

By dividing the smoothed velocity by the smoothed volatility, the script produces two different visual lines on your chart:

  • The Smooth Line (Magenta): This represents the "Triple Hull" result. Because it has passed through three layers of filtering, it is highly stable. It is designed to help traders identify long-term trends and major shifts in momentum without being distracted by "false signals" or temporary price spikes.
  • The Fast Line (White): This uses only two layers of smoothing. It remains more responsive than the magenta line, allowing you to see shorter-term momentum changes while still benefiting from a significant amount of noise reduction compared to standard market indicators.

Summary for Traders

By using these triple-layered calculations, the indicator provides a balanced view of where the market is headed. It prioritizes "clean" data, ensuring that when the lines move, they are responding to meaningful market momentum rather than random price jitter.

Miscellaneous
Implements a curve of type %1
10 Views
0 Downloads
0 Favorites
RSI_TripleHull
//+------------------------------------------------------------------+
//|                                              rsi_triple_hull.mq4 |
//|                   Copyright © 2006, Matt Kennel. Licensed GPL v2 |
//|                                        http://www.metatrader.org |
//+------------------------------------------------------------------+

//
//  A smooth RSI indicator (in purple by default)
//  and a faster RSI (in white by default).
// 
// Uses three Hull MA's on velocity and volatility, then divides.
// 

#property copyright "Copyright © 2006, Matt Kennel. Licensed GPL v2"
#property link      "http://www.metatrader.org"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Magenta
#property indicator_color2 White
#property indicator_level1 70
#property indicator_level2 30
#property indicator_level3 50
#property indicator_maximum 100
#property indicator_minimum 0

//---- input parameters
extern int Len=14; 
double rsi_triple_hull[];
double rsi_triple_hullfast[]; 

double rsi_triple_hullvalue, VelocityRaw, vel_HMA1, vel_HMA2, vel_HMA3, vol_HMA1, vol_HMA3;
double Mixing, MixingC, vel_1A, vel_1B, vel_2A, vel_3A, vol_HMA2;
double vel_3B, vol_1A, vol_1B, vol_2A, vol_2B, vol_3A, vol_3B, vel_2B;

int init() {
  SetIndexStyle(0,DRAW_LINE);
  SetIndexBuffer(0,rsi_triple_hull);
  IndicatorShortName("RSX_TripleHull("+Len+")");
  SetIndexStyle(1,DRAW_LINE);
  SetIndexBuffer(1,rsi_triple_hullfast); 
  Mixing = 3.0 / (Len + 2.0);
  MixingC = 1.0 - Mixing;
  
  return(0);
}

int deinit()
{
return(0);
}

int start()
{
  int counted_bars=IndicatorCounted(),limit,shift;

  if (counted_bars<0) return(-1);
  if (counted_bars>0) counted_bars--;
  limit=Bars-Len-2;
 //  if(counted_bars>Len) limit=Bars-counted_bars-1;

  for (shift=limit;shift>=0;shift--) {
    VelocityRaw = 100.0*(Close[shift]-Close[shift+1]); // velocity f8 - f10;
    
    //  a Hull MA.
    vel_1A = MixingC * vel_1A + Mixing * VelocityRaw;
    vel_1B = Mixing * vel_1A + MixingC * vel_1B;
    vel_HMA1 = vel_1A * 1.5 - vel_1B * 0.5;

    // another Hull MA
    vel_2A = MixingC * vel_2A + Mixing * vel_HMA1;
    vel_2B = Mixing * vel_2A + MixingC * vel_2B; 
    vel_HMA2 = vel_2A * 1.5 - vel_2B * 0.5;
    
    // Yet another Hull MA; 
    vel_3A = MixingC * vel_3A + Mixing * vel_HMA2;
    vel_3B = Mixing * vel_3A + MixingC * vel_3B;
    vel_HMA3 = vel_3A * 1.5 - vel_3B * 0.5;
    
    // Onto volatility. 
    vol_1A = MixingC * vol_1A + Mixing * MathAbs(VelocityRaw);
    vol_1B = Mixing * vol_1A + MixingC * vol_1B;
    vol_HMA1 = vol_1A * 1.5 - vol_1B * 0.5;

    // Hull MA
    vol_2A = MixingC * vol_2A + Mixing * vol_HMA1;
    vol_2B = Mixing * vol_2A + MixingC * vol_2B;
    vol_HMA2 = vol_2A * 1.5 - vol_2B * 0.5;
    
    // Hull MA
    vol_3A = MixingC * vol_3A + Mixing * vol_HMA2;
    vol_3B = Mixing * vol_3A + MixingC * vol_3B;
    vol_HMA3 = vol_3A * 1.5 - vol_3B * 0.5;

    rsi_triple_hull[shift] = (vel_HMA3 / vol_HMA3 + 1.0) * 50.0;
    rsi_triple_hullfast[shift] = (vel_HMA2 / vol_HMA2+1.0)*50.0; 
    
  }
return(0);
}

Comments