Benefits
* Filters False Signals
* Trend System
* Easy to read and implement
Trading Strategies
You can use this indicator to buy when the line reaches the bottom level of 0.2 and to exit the long position when it reaches the level of 0.5 above. Sell when the line crosses the level of 0.8 above and out of short positions when the line crosses the bottom level of 0.5.
Input parameters:
* Gamma (default = 0.7) - the coefficient which is used in the calculation of the line. The higher, the more the line will be flat.
* CountBars (default = 950) - the maximum number of bar graph, which will be calculated as an indicator. Install the largest possible number, if you do not have problems with the computer's performance.
Laguerre RSI indicator settings:
Gamma: 0.85
Count Bars: 9500
Default parameters: Fixed minimum -0.05 Fixed Maximum 1.05
Default Levels: 0.85, 0.45 and 0.15
Laguerre Filter line setting Gamma: 0.85
Code For Laguerre RSI:
//+------------------------------------------------------------------+
//| Laguerre RSI.mq4 |
//|
//+------------------------------------------------------------------+
#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);
}
//+------------------------------------------------------------------+
An additional Forex indicator — Laguerre Filter line — is drawn directly over the charts and looks like a moving average. Laguerre Filter line filters Laguerre RSI signals.
When Laguerre RSI tells to go Long (buy), Forex traders would enter only if price is above Laguerre Filter line. Opposite true for Sell signals: when Laguerre RSI signals to Short, price must be below Laguerre Filter line in order for a signal to be valid.
Code for Laguerre Filter
//+------------------------------------------------------------------+
//| LaguerreFilter.mq4 |
//| Copyright © 2006, Forex-TSD.com |
//| Written by IgorAD,igorad2003@yahoo.co.uk |
//| http://finance.groups.yahoo.com/group/TrendLaboratory |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Forex-TSD.com "
#property link "http://www.forex-tsd.com/"
#property indicator_chart_window
#property indicator_color1 Yellow
//---- input parameters
extern double gamma = 0.7;
extern int Price_Type = 0;
//---- buffers
double Filter[];
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, "LaguerreFilter");
SetIndexBuffer(0, Filter);
SetIndexBuffer(1, L0);
SetIndexBuffer(2, L1);
SetIndexBuffer(3, L2);
SetIndexBuffer(4, L3);
//----
string short_name="LaguerreFilter(" + 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--)
{
double Price=iMA(NULL,0,1,0,0,Price_Type,i);
L0[i] = (1.0 - gamma)*Price + 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];
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)
Filter[i] = (L0[i] + 2 * L1[i] + 2 * L2[i] + L3[i]) / 6.0;
}
return(0);
}
//+------------------------------------------------------------------+
Laguerre Filter line doesn't filter all false signals, though.
Forex trades may choose to play with Laguerre RSI settings in order to make Laguerre indicator more or less sensitive. Settings apply to Gamma parameters. Common settings are:
Gamma 0.85
Gamma 0.7
Gamma 0.55
When using Laguerre Filter line together with Laguerre RSI in Forex, make sure they both have the same Gamma settings
The graph shows the detail chat of market for a limited period. Generally professional traders want this type of chat for detail. Keep it up....
ReplyDeleteForex Trading Basics