Ehlers Fisher transform
Download scriptThis technical indicator is designed to provide traders with a clearer view of market momentum by applying a specific mathematical transformation to price data. Instead of simply tracking the raw price movement, it seeks to normalize fluctuations into a standardized range, making it easier to identify trends and potential turning points.
How the Logic Works
1. Data Smoothing The process begins by establishing a consistent baseline for price action. Rather than using every tick of raw data, the script looks at a specific moving average (based on a user-defined period). By choosing a median price type, the indicator filters out extreme "noise" from the market, ensuring that the subsequent calculations are based on the core trend of the asset.
2. Range Normalization The core of this logic involves identifying the highest and lowest points within the selected timeframe. The script calculates where the current price sits relative to these highs and lows. This allows the tool to understand whether the price is pushing toward a boundary or retreating from one. To ensure smoothness, it uses a weighted approach—balancing the current position against previous values so that the resulting data doesn't jump erratically but flows in a fluid motion.
3. The Transformative Calculation Once the price position is identified relative to its recent range, the script applies a unique mathematical transformation (the Fisher Transform). This converts the normalized values into a specific scale that highlights acceleration. In simpler terms, it takes a standard "up and down" movement and stretches or compresses it to make trends more visible to the human eye.
4. Trend Visualization and Signaling The final output is displayed in a separate window below your main price chart. It produces two distinct visual elements:
- The Main Line: This represents the primary transformed momentum of the asset.
- The Signal Line: When enabled, this acts as a secondary reference point based on previous values. By comparing where the current momentum sits in relation to this signal line, traders can better identify when a trend is gaining strength or starting to lose steam.
Summary for the User
Essentially, this tool takes "messy" market price movements and cleans them up into a smooth, readable wave. It helps you see whether the market is moving with conviction or just drifting, providing a visual representation of momentum that is much easier to interpret than looking at raw candles alone.
//+----------------------------------------------------------+
//| Ehlers fisher transform.mq4 |
//| mladen |
//+----------------------------------------------------------+
#property copyright "mladen"
#property link "mladenfx@gmail.com"
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 DimGray
#property indicator_color2 YellowGreen
#property indicator_width1 2
#property indicator_style2 STYLE_DOT
//
//
//
//
//
extern int period = 10;
extern int PriceType = PRICE_MEDIAN;
extern bool showSignalLine = true;
//
//
//
//
//
double buffer1[];
double buffer2[];
double Prices[];
double Values[];
//+----------------------------------------------------------+
//| |
//+----------------------------------------------------------+
//
//
//
//
//
int init()
{
IndicatorBuffers(4);
SetIndexBuffer(0,buffer1);
SetIndexBuffer(1,buffer2);
SetIndexBuffer(2,Prices);
SetIndexBuffer(3,Values);
IndicatorShortName("Ehlers\' Fisher transform ("+period+")");
return(0);
}
//+----------------------------------------------------------+
//| |
//+----------------------------------------------------------+
//
//
//
//
//
int start()
{
int counted_bars=IndicatorCounted();
int i,limit;
if(counted_bars < 0) return(-1);
if(counted_bars > 0) counted_bars--;
limit = Bars-counted_bars;
//
//
//
//
//
for(i=limit; i>=0; i--)
{
Prices[i] = iMA(NULL,0,1,0,MODE_SMA,PriceType,i);
//
//
//
//
//
double MaxH = Prices[ArrayMaximum(Prices,period,i)];
double MinL = Prices[ArrayMinimum(Prices,period,i)];
if (MaxH!=MinL)
Values[i] = 0.33*2*((Prices[i]-MinL)/(MaxH-MinL)-0.5)+0.67*Values[i+1];
else Values[i] = 0.00;
Values[i] = MathMin(MathMax(Values[i],-0.999),0.999);
//
//
//
//
//
buffer1[i] = 0.5*MathLog((1+Values[i])/(1-Values[i]))+0.5*buffer1[i+1];
if (showSignalLine)
buffer2[i] = buffer1[i+1];
}
return(0);
}
Comments