This script is a specialized technical analysis tool designed for the MetaTrader platform to help traders identify specific momentum shifts and potential entry points in financial markets. It operates by processing price data through a multi-layered calculation to filter out market "noise" and highlight significant trends.
Core Methodology
The logic functions by following a three-step progression:
1. Momentum Baseline The tool begins by calculating a basic momentum value (using the WillRogers Price oscillator). Instead of looking at raw price alone, it measures how quickly the price is moving relative to its recent history. This helps establish the foundational "energy" of the current market move.
2. Smoothing and Averaging To prevent the indicator from reacting too wildly to minor, insignificant price flickers, the script applies a Moving Average to that momentum data. This smoothing process creates a cleaner trend line, ensuring that the signals generated are based on sustained movements rather than momentary volatility.
3. Signal Conversion (The "Fish" Logic) The most unique part of this script is how it translates these smoothed values into visual signals. It uses a mathematical transformation to convert the smoothed data into a specialized range. This results in three distinct behaviors on your chart:
- Buy Signals: When the momentum pushes strongly toward the upper threshold, the tool identifies a "Buy" zone.
- Sell Signals: When the momentum drops significantly toward the lower threshold, it identifies a "Sell" zone.
- Neutral Zone: When the market is moving sideways or lacks clear conviction, the indicator remains centered, suggesting a lack of strong directional bias.
Visual Interpretation
For the user, this means the tool provides a clearer picture of market sentiment. Rather than just showing you where the price is, it interprets the "strength" of the trend. It aims to isolate high-conviction moments—where the market is moving with enough force to be considered a valid trend—while filtering out the erratic movements that often lead to false signals in standard trading environments.
//+------------------------------------------------------------------+
//| VininI_Cyber |
//| Copyright © 2009, Victor Nicolaev |
//| e-mail: vinin@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, Victor Nicolaev"
#property link "e-mail: vinin@mail.ru"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Blue
#property indicator_color2 Lime
#property indicator_color3 Red
#property indicator_level1 -0.5
#property indicator_level2 0
#property indicator_level3 0.5
#property indicator_minimum -1.05
#property indicator_maximum 1.05
//---- input parameters
extern int WPR_Period=5;
extern int WPR_Price =0;
extern int MA_Period =9;
extern int MA_Method =3;
//---- buffers
double Value[];
double MA[];
double iFish[];
double Buy[];
double Sell[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init() {
IndicatorBuffers(5);
SetIndexBuffer(0, iFish);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(1, Buy);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(2, Sell);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(3, Value);
SetIndexBuffer(4, MA);
return(0);
}
int deinit() { return(0); }
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start() {
int counted_bars = IndicatorCounted(), i;
if (counted_bars < 0) return(-1);
if (counted_bars > 0) counted_bars--;
int limit=Bars - counted_bars;
for(i = limit; i >= 0; i--) Value[i]=0.1*(iWPR(NULL,0,WPR_Period,i)+50.0);
for(i = limit; i >= 0; i--) MA[i]=iMAOnArray(Value,0,MA_Period,0,MA_Method,i);
for(i = limit; i >= 0; i--) {
iFish[i]=(MathExp(2.0*MA[i])-1.0)/(MathExp(2.0*MA[i])+1.0);
if (iFish[i]> 0.5) {Buy[i] =iFish[i]; Buy[i+1] =iFish[i+1];}
if (iFish[i]<-0.5) {Sell[i]=iFish[i]; Sell[i+1]=iFish[i+1];}
}
return(0);
}
//+------------------------------------------------------------------+
Comments