StepFisher_v1[1].1

Download script
Author: Copyright � 2005, TrendLaboratory Ltd.
StepFisher_v1[1].1

The StepFisher v1 is a sophisticated technical analysis tool designed to identify market trends and momentum by combining price action, volatility-based boundaries, and smoothed mathematical transformations. Unlike standard indicators that might react too quickly to market "noise," this script focuses on identifying significant structural shifts in price movement.

How the Logic Works

The indicator operates through a multi-layered calculation process:

1. Volatility-Based Boundaries (The "Step" Mechanism) The tool begins by measuring recent market volatility using a standard volatility metric (ATR). It uses this data to establish dynamic boundaries above and below the current price. These boundaries act as "floors" and "ceilings." Instead of moving fluidly with every tick, these levels are designed to capture significant price breakthroughs, effectively creating "steps" that define the current market direction.

2. Trend Determination The script constantly monitors whether the closing price is breaking through these established volatility boundaries.

  • If the price climbs above a high boundary, it identifies an upward trend.
  • If the price drops below a low boundary, it identifies a downward trend. A key feature here is that the boundaries are designed to "lock" in place during a sustained move until a significant enough change occurs, which helps filter out minor fluctuations that could lead to false signals.

3. Price Normalization Once the trend and boundaries are established, the tool calculates where the current price sits relative to these boundaries. It converts this position into a normalized value (a scale), helping to determine how "strong" the current move is compared to the overall range of the recent volatility.

4. Smoothing and Momentum (The Fisher Transformation) To make the data readable and useful for trading, the script applies two final mathematical layers:

  • Smoothing: It blends the current normalized value with its previous value to ensure a smooth transition between movements.
  • Fisher Transformation: The script applies a logarithmic transformation (similar to how traders use the Fisher Transform to normalize price distributions). This converts the smoothed data into a more linear and visually clear indicator of momentum.

Visual Output

The script produces two primary lines on your chart:

  • The Main Trend Line: Represents the core momentum calculated by the system.
  • The Trigger Line: A slightly delayed version of the main line, used to help traders identify the exact point where momentum shifts or confirms a trend change.

By combining volatility-based boundaries with advanced mathematical smoothing, StepFisher v1 aims to provide a clearer picture of market direction than standard moving averages or oscillators alone.

Indicators Used
Indicator of the average true rangeMoving average indicator
Miscellaneous
Implements a curve of type %1
13 Views
0 Downloads
0 Favorites
StepFisher_v1[1].1
//+------------------------------------------------------------------+
//|                                                StepFisher_v1.mq4 |
//|                           Copyright © 2006, TrendLaboratory Ltd. |
//|            http://finance.groups.yahoo.com/group/TrendLaboratory |
//|                                       E-mail: igorad2004@list.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, TrendLaboratory Ltd."
#property link      "http://finance.groups.yahoo.com/group/TrendLaboratory"

#property indicator_separate_window
#property indicator_maximum 4.5
#property indicator_minimum -4.5
#property indicator_buffers 2
#property indicator_color1 LightBlue
#property indicator_color2 Orange
//---- input parameters
extern int    Length=10;
extern int    Price=4;
extern int    Shift=1;
extern double Kv=1.0;
extern int    NumBars=0;
//---- indicator buffers
double UpBuffer[];
double DnBuffer[];
double Fisher[];
double Value[];
double smax[];
double smin[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
  int init()
  {
   string short_name;
//---- indicator line
   IndicatorBuffers(6);
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1);
   SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1);
   SetIndexBuffer(0,UpBuffer);
   SetIndexBuffer(1,DnBuffer);
   SetIndexBuffer(2,Fisher);
   SetIndexBuffer(3,Value);
   SetIndexBuffer(4,smax);
   SetIndexBuffer(5,smin);
   
   IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
//---- name for DataWindow and indicator subwindow label
   short_name="StepFisher v1("+Length+","+Price+","+Kv+")";
   IndicatorShortName(short_name);
   SetIndexLabel(0,"Fish");
   SetIndexLabel(1,"Trigger");
//----
   SetIndexDrawBegin(0,Length);
   SetIndexDrawBegin(1,Length);
//----
   return(0);
  }

//+------------------------------------------------------------------+
//| StepFisher_v2                                                       |
//+------------------------------------------------------------------+
int start()
  {
   int      shift,trend;
   double   ATR0,ATRmax=-10000000;
   double   line,bsmin,bsmax;
   
   if (NumBars>0) int NBars=NumBars; else NBars=Bars;
   
   for(shift=NBars;shift>=0;shift--)
   {	
   UpBuffer[shift]=0.0;
   DnBuffer[shift]=0.0;
   smax[shift]=0.0;
   smin[shift]=0.0;     
   Value [shift]=0.0;
   Fisher[shift]=0.0;   
   }
   
   for(shift=NBars-1-Length;shift>=0;shift--)
   {	
	ATR0 = iATR(NULL,0,Length,shift);
	
	ATRmax=MathMax(ATR0,ATRmax);
		
	double StepSize=(Kv*ATRmax);
		  
	  smax[shift]=Close[shift]+2*StepSize;
	  smin[shift]=Close[shift]-2*StepSize;
	    
	  if(Close[shift]>smax[shift+1]) trend=1; 
	  if(Close[shift]<smin[shift+1]) trend=-1;
	  
	  if(trend>0)
	  {
	  if(smin[shift]<smin[shift+1]) smin[shift]=smin[shift+1];
	  line=smin[shift]+StepSize;
	  }
	  if(trend<0)
	  {
	  if(smax[shift]>smax[shift+1]) smax[shift]=smax[shift+1];
	  line=smax[shift]-StepSize;
	  }
	  
	  bsmin=line-StepSize;
	  bsmax=line+StepSize;

	  double price = iMA(NULL,0,1,0,0,Price,shift);
     if (bsmax==bsmin) bsmax=bsmin+0.0001; 
  
     double sto=(price-bsmin)/(bsmax-bsmin);         
   
     Value[shift] = 0.33*2*(sto-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];
     
     UpBuffer[shift] = Fisher[shift];
     DnBuffer[shift] = Fisher[shift+Shift];
  
    

	 }
	return(0);	
 }

Comments