Fisher Transform_v1

Author: Copyright � 2006, Forex-TSD.com
Fisher Transform_v1

This technical indicator is designed to help traders identify market trends and potential price extremes by analyzing the momentum of price movement. Rather than just looking at where the price is currently, it calculates how "stretched" the price has become relative to its recent history.

Core Logic and Data Processing

The script begins by examining a specific window of past price data (defined by the user). Within this timeframe, it identifies two key boundaries: the highest price reached and the lowest price reached. It then looks at a specific price point—such as the closing price or the median price—to determine where that value sits between those two extremes.

This creates a percentage-based "position" for the current price. To ensure the data is smooth and not erratic, the script applies a weighted smoothing technique. This means it doesn't just react instantly to every tiny wiggle in the market; instead, it blends the current position with previous values to create a fluid, continuous motion.

The Fisher Transformation

The "heart" of this script is the Fisher Transform. Once the price position is smoothed, the logic applies a mathematical transformation that converts those values into a different scale. This specific type of calculation is highly effective at:

  • Normalizing Data: It takes irregular market movements and puts them into a more readable format.
  • Identifying Overextensions: It helps highlight when a price move has become "overbought" or "oversold"—essentially telling the trader when the market is moving too fast in one direction and might be due for a reversal.

Visual Signals and Thresholds

The indicator populates a separate window on your chart with several lines to help with decision-making:

  • The Main Line: Represents the transformed Fisher value, showing the current momentum.
  • The Trigger: A secondary line used to identify specific moments where the momentum shifts direction.
  • Dynamic Boundaries (Upper and Lower Lines): The script automatically calculates the maximum and minimum values reached during the observation period. It then plots horizontal levels based on these extremes. These act as "fences," helping you see how far the current price has traveled compared to its recent peaks and valleys.

Summary of Use

In simple terms, this tool takes raw, messy price movements and converts them into a smoothed momentum wave. By watching how this wave interacts with the automatically generated upper and lower "fences," traders can better identify when a trend is gaining strength or when it has reached an extreme point where a pullback might occur.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
15 Views
0 Downloads
0 Favorites
Fisher Transform_v1
//+------------------------------------------------------------------+
//|                                              Fisher_org_v1.1.mq4 |
//|                                  Copyright © 2006, Forex-TSD.com |
//|                                                Written by IgorAD |
//|            http://finance.groups.yahoo.com/group/TrendLaboratory |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Forex-TSD.com "
#property link "http://www.forex-tsd.com/"

#property indicator_separate_window
#property indicator_maximum 3.0
#property indicator_minimum -3.0
#property indicator_buffers 6
#property indicator_color1 LightBlue
#property indicator_color2 Tomato
#property indicator_color3 Gray
#property indicator_color4 Gray
#property indicator_color5 Gray
#property indicator_color6 Gray

//---- input parameters
extern int Length=10;         // Period of Fisher Transform
extern int Price=4;           // 0-Close;1-Open;2-High;3-Low;4-median;5-typical;6-weighted
extern int CalcBars=100;      // Number of Last Bars 
extern int NumBars=0;         // Number of Bars on the Chart
extern int Offset=70;         // Offset for lines
//---- buffers
double Fisher[];
double Buffer[]; 
double UpLine1[];
double DnLine1[];   
double UpLine2[];
double DnLine2[]; 
double Value [];



int init()
  {
  IndicatorBuffers(7);
  
  SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1);
  SetIndexStyle(1,DRAW_LINE,STYLE_DOT,1);
  SetIndexStyle(2,DRAW_LINE,STYLE_DOT,0);
  SetIndexStyle(3,DRAW_LINE,STYLE_DOT,0);
  SetIndexStyle(4,DRAW_LINE,STYLE_DOT,0);
  SetIndexStyle(5,DRAW_LINE,STYLE_DOT,0);
  
  SetIndexBuffer(0,Fisher);
  SetIndexBuffer(1,Buffer);
  SetIndexBuffer(2,UpLine1);
  SetIndexBuffer(3,DnLine1);
  SetIndexBuffer(4,UpLine2);
  SetIndexBuffer(5,DnLine2);
  SetIndexBuffer(6,Value);
  
  IndicatorShortName ("Fisher Transform");
  SetIndexLabel (0, "Fish");
  SetIndexLabel (1, "Trigger");
  
  SetIndexDrawBegin(0,Length);
  SetIndexDrawBegin(1,Length);
  SetIndexDrawBegin(2,Length);
  SetIndexDrawBegin(3,Length); 
  SetIndexDrawBegin(4,Length);
  SetIndexDrawBegin(5,Length); 
  
  SetIndexShift( 2, Offset);   
  SetIndexShift( 3, Offset); 
  SetIndexShift( 4, Offset); 
  SetIndexShift( 5, Offset); 
  
  return(0);
  }


//+------------------------------------------------------------------+
//| Fisher_org_v1.1                                                         |
//+------------------------------------------------------------------+
int start()
  {
  int shift;
   
  double smin=0,smax=0,maxfish=-1000000,minfish=1000000;                    

if (NumBars>0) int NBars=NumBars; else NBars=Bars;
if (CalcBars>0) int CBars=CalcBars; else CBars=NBars;

for(shift=NBars;shift>=0;shift--)
   {	
   Buffer[shift]=0.0;
   Value [shift]=0.0;
   Fisher[shift]=0.0;   
   }
   
for(shift=NBars-2-Length;shift>=0;shift--)
   {	
   smax = High[Highest(NULL,0,MODE_HIGH,Length,shift)];
   smin = Low[Lowest(NULL,0,MODE_LOW,Length,shift)];
  
   double price = iMA(NULL,0,1,0,0,Price,shift);
   
   if (smax-smin < Point) smax=smin+Point; 
   
   double wpr=(price-smin)/(smax-smin);         
   
   Value[shift] = 0.33*2*(wpr-0.5) + 0.67*Value[shift+1];     
   
   if (Value[shift]> 0.99) Value[shift]= 0.999; 
   if (Value[shift]<-0.99) Value[shift]=-0.999; 
   
   
   Fisher[shift] = 0.5*MathLog((1.0+Value[shift])/(1.0-Value[shift]))+0.5*Fisher[shift+1];
   Buffer[shift] = Fisher [shift+1];       
   
   if (shift<=CBars-1)
   {
   maxfish=MathMax(maxfish,Fisher[shift]);
   minfish=MathMin(minfish,Fisher[shift]);
   }
   
   }
      
   Comment ( " MaxFish= ",maxfish, " MinFish= ",minfish);
   
   double fishlevel = NormalizeDouble(MathMax(maxfish,MathAbs(minfish)),2); 
   
   for(shift=NBars-2-Length;shift>=0;shift--) 
   {
   UpLine1[shift]=fishlevel;
   UpLine2[shift]=0.5*fishlevel;
   DnLine1[shift]=-fishlevel;
   DnLine2[shift]=-0.5*fishlevel;
   }
  
  return(0);
  }
//+------------------------------------------------------------------+

Comments