Inverse-Fisher-Transform-RSI

Download script

This tool is designed to provide traders with a clearer, more readable way to identify market turning points by refining the standard Relative Strength Index (RSI). While the traditional RSI is a popular momentum oscillator, it can sometimes produce "noisy" signals that make it difficult to pinpoint the exact moment a trend might shift. This script solves that issue by applying a specific mathematical transformation to the data.

How the Logic Works

The script processes market data through three distinct stages to create a smoother, more actionable visual:

1. Data Normalization The process begins by taking the standard RSI value—which typically moves between 0 and 100—and shifting it so that it is centered around zero. By subtracting 50 from the RSI value, the script creates a neutral baseline. This allows the tool to treat upward momentum and downward momentum with equal mathematical weight.

2. The Inverse Fisher Transformation Once the data is centered, the script applies what is known as an "Inverse Fisher Transform." In plain terms, this is a formula used to "compress" extreme values and "expand" values near the center.

  • When price movement is very strong (extreme), the transform prevents the indicator from flying off the charts or staying at a flat ceiling too long.
  • When price movement is more moderate, the transform helps highlight subtle changes in direction that might otherwise be ignored by a standard RSI.

3. Re-scaling for Visual Clarity Finally, after the transformation is complete, the script scales the data back into a readable format. It converts the processed values back into a 0–100 range. This ensures that while the underlying "shape" of the movement has been mathematically refined for better accuracy, the final result still looks and feels like a familiar indicator on your chart.

The Practical Benefit

The primary goal of this logic is to provide "cleaner" triggers. By using the Inverse Fisher Transform on an RSI base, the indicator aims to filter out market noise and provide more distinct peaks and valleys. For a trader, this means less ambiguity when deciding whether a trend is truly exhausted or if there is still significant momentum remaining in the current move.

Indicators Used
Relative strength index
Miscellaneous
Implements a curve of type %1
12 Views
0 Downloads
0 Favorites
Inverse-Fisher-Transform-RSI
//+------------------------------------------------------------------+
//|                                 Inverse-Fisher-Transform-RSI.mq4 |
//+------------------------------------------------------------------+
#property description "Developed by John Ehlers, the RSI-based inverse Fisher " 
#property description "Transform is used to help clearly define trigger points."
#property description "The normal RSI indicator is calculated and adjusted so"
#property description "that the values are centered around zero."
#property description "The inverse transform is then applied to these values."
#property description "Metatrader Code by Max Michael 2022"
#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1  DodgerBlue
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_levelcolor DimGray
#property indicator_levelwidth 1
#property indicator_levelstyle 0
#property indicator_level1  80
#property indicator_level2  20
#property strict

extern int             RsiPeriod = 20;
extern ENUM_APPLIED_PRICE  price = PRICE_CLOSE;
extern int          NumberOfBars = 1000;

double         fRSIbuffer[];

int init()
{  
   SetIndexBuffer(0,fRSIbuffer); SetIndexStyle(0,DRAW_LINE); SetIndexLabel(0,"Inverse-Fisher-RSI");
   IndicatorShortName("Inverse-Fisher-RSI("+ IntegerToString(RsiPeriod) +")");
   IndicatorDigits(2);
   return(0);
}

int start()
{   
   int CountedBars=IndicatorCounted();
   if (CountedBars<0) return(-1);
   int i=Bars-CountedBars-1;
   if (i>NumberOfBars) i=MathMin(NumberOfBars,Bars-1);
   
   while(i>=0)
   {
      double rsi=iRSI(_Symbol,0,RsiPeriod,price,i);
      double x=0.1*(rsi-50);
      double y=(MathExp(2*x)-1)/(MathExp(2*x)+1);
      double ynormal=50*(y+1);
      fRSIbuffer[i]=ynormal;
      i--;     
   }
   return(0);
}

Comments