RAVI FX Fisher_v1
Download scriptThis tool is designed to help traders visualize market momentum and price trends by calculating the relationship between fast-moving price actions and slower, long-term averages. Instead of looking at raw price numbers, it converts market behavior into a specialized oscillator that helps identify when a trend is gaining strength or beginning to exhaust.
How the Logic Works
1. Comparative Analysis The script works by comparing two different moving averages: a "fast" average (which reacts quickly to recent price changes) and a "slow" average (which tracks the broader trend). By measuring the distance between these two, the tool determines how much momentum is currently present in the market.
2. Volatility Normalization To ensure the data is consistent regardless of whether the market is highly volatile or very calm, the script incorporates an Average True Range (ATR) calculation. This "normalizes" the data, essentially adjusting the readings so that the same type of price move looks the same on a chart, whether it happened during a massive price spike or a period of low activity.
3. The Fisher Transformation The core unique logic of this script is the application of a mathematical "Fisher Transformation." This converts the calculated momentum into a specific range. The goal of this transformation is to smooth out the noise of the market and make it easier to see significant turning points. It helps highlight when a trend is reaching an extreme state, making it more visually obvious for a trader to identify potential shifts in direction.
4. Visual Signals The final output appears on your chart as a histogram accompanied by two steady boundary lines (the high and low triggers).
- The Histogram: Represents the transformed momentum of the market.
- The Trigger Lines: These act as "thresholds." When the histogram moves beyond these upper or lower limits, it signals that the current price movement has reached a significant level of intensity, providing a visual cue for potential overextended conditions.
//+------------------------------------------------------------------+
//| 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 MediumSeaGreen
#property indicator_color2 MediumVioletRed
#property indicator_color3 MediumVioletRed
//---- input parameters
extern int MAfast=4;
extern int MAslow=49;
extern double trigger=0.07;
extern int maxbars=500;
//---- buffers
double RAVIfxFishBuffer[];
double LoTrigBuff[];
double HiTrigBuff[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_HISTOGRAM);
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);
IFish=(MathExp(2*MAValue)-1)/(MathExp(2*MAValue)+1);
RAVIfxFishBuffer[shift]=IFish;
LoTrigBuff[shift]=-trigger;
HiTrigBuff[shift]=trigger;
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments