Author: Copyright � 2005, Kiko Segui
FX_FISH_v1

The FX_FISH indicator is a sophisticated momentum and trend-following tool designed to help traders identify market direction and potential entry or exit points. Rather than relying on simple price movements, it uses a mathematical smoothing process to interpret the "strength" of the current price action relative to recent historical volatility.

Core Logic and Price Processing

The script begins by analyzing specific price data points based on user preferences (such as the opening, closing, high, or low prices). It looks back at a defined period of time to establish the highest highs and lowest lows. By comparing the current price to these extremes, the indicator determines where the price sits within its recent range.

The "Fish" Calculation

The core of the script revolves around a two-step calculation:

  1. Normalization: It converts the raw price data into a normalized value that fluctuates between specific boundaries. This helps smooth out minor market noise.
  2. Logarithmic Transformation: The script then applies a logarithmic function to these values. This produces the "Fish" metric, which creates a distinct visual representation of momentum. By using a weighted average of previous results, the indicator ensures that the movement is fluid and not erratic, preventing it from reacting too violently to single-bar fluctuations.

Visual Representation

The indicator displays its results in a separate window as two distinct histograms:

  • SteelBlue: Represents positive momentum (bullish sentiment).
  • Orange: Represents negative momentum (bearish sentiment).

As the "Fish" value moves above or below zero, it shifts between these two colors, allowing traders to see at a glance whether the market is leaning toward an upward or downward trend.

Automated Signaling

Beyond just showing trends, the script includes logic to identify specific high-probability moments:

  • Buy Signals: When the indicator detects a sharp increase in momentum that exceeds a specific threshold, and this movement is stronger than the previous two cycles, it identifies a potential buying opportunity.
  • Sell Signals: Conversely, when it detects a significant drop in momentum falling below the threshold—and that drop is sharper than the preceding cycles—it highlights a potential selling opportunity.
  • Exit Points: The script also monitors for "momentum reversals." If the trend shifts from positive to negative (or vice versa), it identifies these as potential exit points, notifying the trader to consider closing an existing position.

Summary for Traders

In essence, FX_FISH filters out market noise to show you the underlying "flow" of the currency pair. It tells you not just which way the price is moving, but how aggressively it is moving relative to its recent history, providing clear visual cues for entries, exits, and trend confirmation.

Miscellaneous
Implements a curve of type %1
12 Views
0 Downloads
0 Favorites
FX_FISH_v1
// FX_FISH
#property copyright "Copyright © 2005, Kiko Segui"
#property link      "webtecnic@terra.es"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 SteelBlue
#property indicator_color2 Orange

           
double buffer1[];
double buffer2[];


extern int period=10;
extern int price=0; // 0 or other = (H+L)/2
                    // 1 = Open
                    // 2 = Close
                    // 3 = High
                    // 4 = Low
                    // 5 = (H+L+C)/3
                    // 6 = (O+C+H+L)/4
                    // 7 = (O+C)/2
extern bool Mode_Fast= True;
extern bool Signals= False;
      
int init()
  {
  SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,1,SteelBlue);
  SetIndexBuffer(0,buffer1);
  SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,1,Orange);
  SetIndexBuffer(1,buffer2);
  return(0);
  }


int deinit()
  {
  int i;
  double tmp;
  
  
  for (i=0;i<Bars;i++)
    {
    ObjectDelete("SELL SIGNAL: "+DoubleToStr(i,0));
    ObjectDelete("BUY SIGNAL: "+DoubleToStr(i,0));
    ObjectDelete("EXIT: "+DoubleToStr(i,0));
    }
  return(0);
  }


double Value=0,Value1=0,Value2=0,Fish=0,Fish1=0,Fish2=0;

int buy=0,sell=0;

int start()
  {
  int counted_bars=IndicatorCounted();
  int i;
  int barras;
  double _price;
  double tmp;
  
  double MinL=0;
  double MaxH=0;                    
  
  double Threshold=1.2; 

  if(counted_bars>0) counted_bars--;

  //barras = Bars;ç
  barras = Bars-counted_bars;
  if (Mode_Fast)
    barras = 100;
  i = 0;
  while(i<barras)
   {
   MaxH = High[Highest(NULL,0,MODE_HIGH,period,i)];
   MinL = Low[Lowest(NULL,0,MODE_LOW,period,i)];
  
   switch (price)
     {
     case 1: _price = Open[i]; break;
     case 2: _price = Close[i]; break;
     case 3: _price = High[i]; break;
     case 4: _price = Low[i]; break;
     case 5: _price = (High[i]+Low[i]+Close[i])/3; break;
     case 6: _price = (Open[i]+High[i]+Low[i]+Close[i])/4; break;
     case 7: _price = (Open[i]+Close[i])/2; break;
     default: _price = (High[i]+Low[i])/2; break;
     }
   
        
   Value = 0.33*2*((_price-MinL)/(MaxH-MinL)-0.5) + 0.67*Value1;     
   Value=MathMin(MathMax(Value,-0.999),0.999); 
   Fish = 0.5*MathLog((1+Value)/(1-Value))+0.5*Fish1;
   
   buffer1[i]= 0;
   buffer2[i]= 0;
   
   if ( (Fish<0) && (Fish1>0)) 
     {
     if (Signals)
       {
       ObjectCreate("EXIT: "+DoubleToStr(i,0),OBJ_TEXT,0,Time[i],_price);
       ObjectSetText("EXIT: "+DoubleToStr(i,0),"EXIT AT "+DoubleToStr(_price,4),7,"Arial",White);
       }
     buy = 0;
     }   
   if ((Fish>0) && (Fish1<0))
     {
     if (Signals)
       {
       ObjectCreate("EXIT: "+DoubleToStr(i,0),OBJ_TEXT,0,Time[i],_price);
       ObjectSetText("EXIT: "+DoubleToStr(i,0),"EXIT AT "+DoubleToStr(_price,4),7,"Arial",White);
       }
     sell = 0;
     }        
    
   if (Fish>=0)
     {
     buffer1[i] = Fish;
     }
   else
     {
     buffer2[i] = Fish;  
     }
     
   tmp = i;
   if ((Fish<-Threshold) && 
       (Fish>Fish1) && 
       (Fish1<=Fish2))
     {     
     if (Signals)
       {
       ObjectCreate("SELL SIGNAL: "+DoubleToStr(i,0),OBJ_TEXT,0,Time[i],_price);
       ObjectSetText("SELL SIGNAL: "+DoubleToStr(i,0),"SELL AT "+DoubleToStr(_price,4),7,"Arial",Red);
       }
     sell = 1;
     }

  if ((Fish>Threshold) && 
       (Fish<Fish1) && 
       (Fish1>=Fish2))
    {
    if (Signals)
       {
       ObjectCreate("BUY SIGNAL: "+DoubleToStr(i,0),OBJ_TEXT,0,Time[i],_price);
       ObjectSetText("BUY SIGNAL: "+DoubleToStr(i,0),"BUY AT "+DoubleToStr(_price,4),7,"Arial",Lime);
       }
    buy=1;
    }

   Value1 = Value;
   Fish2 = Fish1;  
   Fish1 = Fish;
 
   i++;
   }
  return(0);
  }
//+------------------------------------------------------------------+

Comments