RAVI_FX_Fisher2
Download scriptThe RAVI_FX_Fisher2 is a custom technical analysis tool designed to help traders identify momentum and price trends by calculating the relationship between different moving averages. Instead of simply showing you the price, it transforms price data into a specialized visual oscillator that highlights the strength of market movements.
Core Logic and Mechanics
The script operates based on three primary components:
1. Relative Momentum Calculation The tool begins by comparing two different "speeds" of moving averages—a fast one (which reacts quickly to recent price changes) and a slow one (which represents the broader trend). By measuring the distance between these two, the script determines how much "stretch" there is in the current market. It then adjusts this measurement using volatility data (ATR), ensuring that the indicator remains relevant regardless of whether the market is moving calmly or experiencing wild swings.
2. The Fisher Transformation A key feature of this script is an optional mathematical smoothing process known as the Fisher Transformation. When enabled, the tool takes the raw momentum value and converts it into a standardized format. This is designed to make the peaks and troughs of the market trend easier to read by "linearizing" the data, helping traders see clear signals more effectively without being misled by extreme price outliers.
3. Dynamic Thresholds (Trigger Zones) The script includes a smart system for identifying "Trigger" levels. It automatically adjusts these boundaries based on the timeframe you are viewing (e.g., 1-minute charts vs. 60-minute charts). These triggers act as visual guardrails:
- Upper Boundary: Helps identify areas of overextended upward momentum.
- Lower Boundary: Helps identify areas of overextended downward momentum.
How it appears on your chart
The indicator is displayed in a separate window below your main price chart. It produces a primary line representing the processed momentum and two horizontal boundary lines (the Triggers).
By observing where the main line interacts with these boundaries and how it reacts to the "Fisher" smoothing, traders can better gauge whether a current trend is gaining strength, losing steam, or reaching a point of potential exhaustion.
//+------------------------------------------------------------------+
//| RAVI_FX_Fisher2.mq4 |
//| T.Y |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, Luis Guilherme Damiani"
#property link "http://www.damianifx.com.br"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 RoyalBlue
#property indicator_color2 PaleVioletRed
#property indicator_color3 PaleVioletRed
#property indicator_width1 2
#property indicator_width2 1
#property indicator_width3 1
#property indicator_level1 0
//---- input parameters
extern int MAfast = 3;
extern int MAslow = 32;
extern int MA_Mode = MODE_LWMA;
extern double Trigger = 0.0; // 0.07
extern bool Apply_IFT=true;
//---- buffers
double RAVIfxFishBuffer[];
double LoTrigBuff[];
double HiTrigBuff[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,RAVIfxFishBuffer);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,LoTrigBuff);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,HiTrigBuff);
if(Trigger>0.0) return(0);
int tf = Period();
if(tf==1) Trigger = 0.01;
if(tf==2) Trigger = 0.014;
if(tf==5) Trigger = 0.02;
if(tf==15) Trigger = 0.04;
if(tf==30) Trigger = 0.06;
if(tf==60) Trigger = 0.08;
if(tf==240) Trigger = 0.14;
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int limit = Bars - counted_bars;
double MAValue;
if(counted_bars<0) return(-1);
if(limit==Bars) limit -= (MAslow+1);
for(int i=limit-1; i>=0; i--){
MAValue = 100.0 * (iMA(NULL,0,MAfast,0,MA_Mode,PRICE_TYPICAL,i) - iMA(NULL,0,MAslow,0,MA_Mode,PRICE_TYPICAL,i))*iATR(NULL,0,MAfast,i)
/iMA(NULL,0,MAslow,0,MA_Mode,PRICE_TYPICAL,i)/iATR(NULL,0,MAslow,i);
if(Apply_IFT) RAVIfxFishBuffer[i] = (MathExp(2*MAValue)-1)/(MathExp(2*MAValue)+1);
else RAVIfxFishBuffer[i] = MAValue;
LoTrigBuff[i] = -Trigger;
HiTrigBuff[i] = Trigger;
}
return(0);
}
//+------------------------------------------------------------------+
Comments