Laguerre RSI Indicator

Metatrader Technical Forex Market Indicator

Metatrader Technical Forex Market Indicator
Laguerre RSI
Metatrader Technical Forex Market Indicator
Laguerre RSI
Metatrader Technical Forex Market Indicator
Laguerre RSI
Metatrader Technical Forex Market Indicator
Laguerre RSI
Metatrader Technical Forex Market Indicator
Laguerre RSI
Metatrader Technical Forex Market Indicator
Laguerre RSI
Metatrader Technical Forex Market Indicator
Laguerre RSI
Metatrader Technical Forex Market Indicator
Laguerre RSI








The Laguerre RSI indicator created by John F. Ehlers is described in his book "Cybernetic Analysis for Stocks and Futures". Cybernetic Analysis for Stocks and Futures seeks to restore the balance between computational power and user proficiency.  In Cybernetic Analysis for Stocks and Futures, noted technical analyst John Ehlers on the art of predicting the market based on tested systems. With application of his engineering expertise, John Ehlers explains the latest, most advanced techniques that help traders predict stock and futures markets with surgical precision. In this book, John Ehlers develops and demonstrates profoundly effective new trading tools through the application of modern digital signal processing techniques. Obtaining accurate cycle measurements within five samples with virtually zero lag, these tools have proven in real-time use to consistently provide traders with razor-sharp buy and sell signals. John Ehlers in this book also presents indicators:
- RVI - Relative Vigor Index - a responsive oscillator in which movement is normalized to the trading range of each bar,
- Fisher Transform - ensure that the density function of any indicator is Gaussian, creating sharper trading signals,
- Super Smoothing Filters - provide more smoothing with less lag,
- Simple Moving Average Computations - two new ways to compute the simple moving average,
- The Sinewave Indicator - a non-causal filter that gives entry and exit signals 1/16 of a cycle period in advance of the turning point,
- Fisher Transform - ensure that the density function of any indicator is Gaussian, creating sharper trading signals,
- Improved Hilbert Transform - a more responsive method to accurately measure market cycles.
 
The Laguerre RSI indicator  is a much more advanced version of the basic Relative Strength Index - RSI indicator, shows the weighted trendline in the separate window of the chart. It can be used for easy entry and exit signals. It uses a 4-Element Laguerre filter to provide a (Time Warp) such that the low frequency components are delayed much more than the high frequency components. This enables much smoother filters to be created using shorter amounts of data. Indicator Laguerre RSI is very simple to use. You simply go long when the indicator moves above the 20% mark and go short when the indicator move below 80%. Inputs Laguerre RSI indicator are, gamma (default = 0.7) - ratio, which is used in the calculation of the line and CountBars (default = 950) - Maximum number of bars of the chart, which would be calculated as an indicator. You can adjust the gamma setting to suit the currency and time frame that you are trading to find the optimal value. The default setting is 0.5, which is quite an aggressive setting but if you want to eliminate of false signals you can increase the gamma setting anywhere up to around 0.85. The recommended setting is 0.65.


Laguerre RSI Indicator MQ4 Code Base (Copy Code)
//+------------------------------------------------------------------+
//|                                                 Laguerre RSI.mq4 |
//|                                Copyright © 2005, David W. Thomas |
//|                                           mailto:davidwt@usa.net |
//+------------------------------------------------------------------+
// based on http://www.mesasoftware.com/TimeWarp.doc.
#property copyright "Copyright © 2005, David W. Thomas"
#property link      "mailto:davidwt@usa.net"

#property indicator_separate_window
#property indicator_level2 0.75
#property indicator_level3 0.45
#property indicator_level4 0.15
#property indicator_minimum 0
#property indicator_maximum 1
#property indicator_buffers 1
#property indicator_color1 MediumPurple

//---- input parameters
extern double    gamma=0.7;

//---- buffers
double RSI[];
double L0[];
double L1[];
double L2[];
double L3[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
   IndicatorBuffers(5);
//---- indicators
   SetIndexStyle(0, DRAW_LINE);
   SetIndexDrawBegin(0, 1);
 SetIndexLabel(0, "Laguerre RSI");
 SetIndexEmptyValue(0, -0.01);
   SetIndexBuffer(0, RSI);
   SetIndexBuffer(1, L0);
   SetIndexBuffer(2, L1);
   SetIndexBuffer(3, L2);
   SetIndexBuffer(4, L3);
//----
   string short_name="LaguerreRSI(" + DoubleToStr(gamma, 2) + ")";
   IndicatorShortName(short_name);
   return(0);
}

//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
{
   return(0);
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{
 int    limit;
 int    counted_bars = IndicatorCounted();
 double CU, CD;
 //---- last counted bar will be recounted
 if (counted_bars>0)
  counted_bars--;
 else
  counted_bars = 1;
 limit = Bars - counted_bars;
 //---- computations for RSI
 for (int i=limit; i>=0; i--)
 {
  L0[i] = (1.0 - gamma)*Close[i] + gamma*L0[i+1];
  L1[i] = -gamma*L0[i] + L0[i+1] + gamma*L1[i+1];
  L2[i] = -gamma*L1[i] + L1[i+1] + gamma*L2[i+1];
  L3[i] = -gamma*L2[i] + L2[i+1] + gamma*L3[i+1];
  //Print(i," Close[i]=",Close[i],", (1.0 - gamma)*Close[i]=",(1.0 - gamma)*Close[i],", gamma*L0[i+1]=",gamma*L0[i+1]);
  //Print(i," L0=",L0[i],",L1=",L1[i],",L2=",L2[i],",L3=",L3[i]);

  CU = 0;
  CD = 0;
  if (L0[i] >= L1[i])
   CU = L0[i] - L1[i];
  else
   CD = L1[i] - L0[i];
  if (L1[i] >= L2[i])
   CU = CU + L1[i] - L2[i];
  else
   CD = CD + L2[i] - L1[i];
  if (L2[i] >= L3[i])
   CU = CU + L2[i] - L3[i];
  else
   CD = CD + L3[i] - L2[i];

  if (CU + CD != 0)
   RSI[i] = CU / (CU + CD);
 }
   return(0);
}
//+------------------------------------------------------------------+