RAVI FX Fisher

Download script
Author: Copyright � 2005, Luis Guilherme Damiani
RAVI FX Fisher

The RAVI FX Fisher is a custom technical analysis tool designed to help traders identify market trends and potential momentum shifts by analyzing the relationship between two different moving averages. Instead of just showing price movement, it transforms complex volatility data into a normalized visual format that makes it easier to spot trend reversals.

How the Logic Works

1. The Core Calculation (Trend Momentum) The script looks at two specific types of moving averages: a "Fast" average and a "Slow" average. By calculating the distance between these two averages, the tool determines the strength of the current price trend. To ensure the data is accurate regardless of whether the asset is expensive or cheap, the logic incorporates "Average True Range" (ATR). This adjusts the calculation based on market volatility, ensuring that the signal remains consistent even when the market becomes unusually calm or wildly erratic.

2. The Fisher Transformation A key feature of this script is the option to apply a mathematical "Fisher Transformation." When enabled, the raw momentum data is converted into a specific range (typically between -1 and 1). This smoothing process helps filter out "market noise"—the small, insignificant price wiggles—allowing the trader to see the underlying primary trend more clearly.

3. Visual Boundaries and Thresholds The indicator provides clear visual boundaries (Upper and Lower triggers). These act as a "safety zone."

  • When the value stays between these boundaries, it indicates a neutral or consolidating market.
  • When the value breaks outside of these boundaries, it suggests that the market momentum has reached a significant level.

4. Automated Alerts The script is programmed to actively monitor these movements in real-time. It keeps track of the previous state of the market to identify exact moments of transition:

  • Downside Shift: If the value drops below the designated lower threshold, the script recognizes a shift toward a bearish (downward) trend and triggers an alert.
  • Upside Shift: If the value rises above the designated upper threshold, the script recognizes a shift toward a bullish (upward) trend and triggers an alert.

Summary for the Trader

Essentially, this tool acts as a sophisticated "trend compass." It takes raw price data, adjusts it for volatility, smooths out the noise using Fisher math, and then notifies you the moment the market momentum crosses a significant threshold to change direction. This allows for quicker identification of trend changes compared to watching standard moving averages alone.

Indicators Used
Indicator of the average true rangeMoving average indicator
Miscellaneous
Implements a curve of type %1It issuies visual alerts to the screen
7 Views
0 Downloads
0 Favorites
RAVI FX Fisher
//+------------------------------------------------------------------+
//|                                               RAVI FX Fisher.mq4 |
//|                         Copyright © 2005, Luis Guilherme Damiani |
//|                                      http://www.damianifx.com.br |
//+------------------------------------------------------------------+
#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 Aqua
#property indicator_color2 Magenta
#property indicator_color3 Magenta
//---- input parameters
extern int       MAfast=4;
extern int       MAslow=49;
extern double trigger=0.07;
extern int       maxbars=500;
extern bool apply_IFT=true;

//---- buffers
double RAVIfxFishBuffer[];
double LoTrigBuff[];
double HiTrigBuff[];
double alertTag;
double prev;
//+------------------------------------------------------------------+
//| 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);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+

int start()
  {
      int    counted_bars=IndicatorCounted();
      double MAValue=0;
      double IFish=0;
      //---- check for possible errors
      if(counted_bars<0) return(-1);
      int limit=Bars-counted_bars;
      if(limit>maxbars)limit=maxbars;
      if (limit>Bars-MAslow-1)limit=Bars-MAslow-1;   
      //---- 
      for (int shift = 0; shift<=limit;shift++)
      {
	     //if period >70 then {LoTrigger=-0.15;HiTrigger=0.15;}else {LoTrigger=-0.07;HiTrigger=0.07;};
	
	     MAValue = 100 * (iMA(NULL,0,MAfast,0,MODE_LWMA,PRICE_TYPICAL,shift) - iMA(NULL,0,MAslow,0,MODE_LWMA,PRICE_TYPICAL,shift))*iATR(NULL,0,MAfast,shift)
	              /iMA(NULL,0,MAslow,0,MODE_LWMA,PRICE_TYPICAL,shift)/iATR(NULL,0,MAslow,shift);
	     if(apply_IFT)IFish=(MathExp(2*MAValue)-1)/(MathExp(2*MAValue)+1);
	     else IFish=MAValue;

        RAVIfxFishBuffer[shift]=IFish;
         LoTrigBuff[shift]=-trigger;
         HiTrigBuff[shift]=trigger;
         if(prev == 0) prev=1;
         if(prev == 1 && RAVIfxFishBuffer[shift] <= -0.07 && alertTag!=Time[0]) {Alert("RAVI_FX Fisher changing Trend to Down on "," rav= "," Period ",Period());alertTag = Time[0];prev = 2;}
         if(prev == 2 && RAVIfxFishBuffer[shift] >= 0.07 && alertTag!=Time[0]) {Alert("RAVI_FX Fisher changing Trend to Up on ",Symbol()," Period ",Period());alertTag = Time[0];prev = 1;}
 
          }
   
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments