VininI_RVI_FOm

Download script
Author: Copyright � 2008, Victor Nicolaev
VininI_RVI_FOm

This tool is designed as a dual-currency analysis indicator for the MetaTrader platform. It allows traders to monitor and compare the momentum dynamics of two different currency pairs simultaneously within a single visual window.

Core Functionality

The script operates by pulling real-time data from two separate currency pairs (which you can define in the settings, such as EURUSD or GBPJPY). It processes this data through a three-step mathematical sequence to produce a smoothed momentum signal for each pair.

The Logic Process

For both currency pairs selected, the tool performs the following calculations:

  1. Momentum Calculation (RVI): The script first identifies the Relative Vigor Index (RVI). This is a standard technical analysis method used to measure the "vigor" or strength of price movements relative to their range. It scales this data to create a primary value for each currency.
  2. Smoothing (Moving Average): To filter out "market noise" and identify clearer trends, the script applies a Moving Average to the RVI values. This ensures that the resulting line is less jumpy and reflects more stable price behavior over a specific period.
  3. Normalization (The "Fish" Formula): The final step applies a specific mathematical transformation (a hyperbolic tangent-style calculation). This compresses the smoothed data into a distinct range between -1 and 1.

Visual Interpretation

  • Two Independent Lines: The tool displays two separate lines on your chart (one for each currency pair), usually distinguished by colors like Green and Red.
  • Signal Boundaries: The indicator features horizontal levels at 0.5 and -0.5.
  • Trend Identification: By observing where the lines sit in relation to these boundaries and the zero line, traders can visually identify which currency pair is showing stronger upward or downward momentum.

Key User Settings

The script is highly customizable, allowing you to:

  • Choose which two currency pairs to track.
  • Adjust the "Period" for both the RVI and the Moving Average (higher numbers create a smoother, slower line; lower numbers make it more reactive).
  • Toggle specific calculation modes for each pair to better suit different trading styles.
Indicators Used
Relative Vigor indexMoving average indicator
Miscellaneous
Implements a curve of type %1
15 Views
0 Downloads
0 Favorites
VininI_RVI_FOm
//+------------------------------------------------------------------+
//|                                              VininI_RSI_FO_2.mq4 |
//+------------------------------------------------------------------+
//|                                                     VininI_Cyber |
//|                                Copyright © 2009, Victor Nicolaev |
//|                                            e-mail: vinin@mail.ru |
//+------------------------------------------------------------------+
//mod x2  NikitaKiev
//mod rvi
#property copyright "Copyright © 2008, Victor Nicolaev"
#property link      "e-mail: vinin@mail.ru"

#property indicator_separate_window
#property indicator_buffers 2

#property indicator_color1 Green
#property indicator_color2 Red

#property indicator_level1  -0.5
#property indicator_level2   0.5
#property indicator_levelcolor   SlateGray

#property indicator_minimum -1.05
#property indicator_maximum  1.05

//---- input parameters 
extern string Pair1;
extern int  RVI_Period1     =10;
extern int  RVI_line_mode1  =0;
extern int  MA_Period1      =5;

extern string Pair2;
extern int  RVI_Period2     =10;
extern int  RVI_line_mode2  =1;
extern int  MA_Period2      =5;
extern string ___;
extern int  MA_Method =3;

extern string note_ = "enter currency pair: EUSD GBPJPY etc";
extern string note = "line mode: 0main 1 sig";
//---- buffers 

double Value[],MA[],iFish[],Value1[],MA1[],iFish1[];
 



//+------------------------------------------------------------------+ 
//| Custom indicator initialization function | 
//+------------------------------------------------------------------+ 
int init() { 

    IndicatorBuffers(6);

    SetIndexStyle(0,DRAW_LINE); 
   SetIndexBuffer(0, iFish); 
   SetIndexBuffer(3, Value);
   SetIndexBuffer(2, MA);  

     SetIndexStyle(1,DRAW_LINE); 
   SetIndexBuffer(1, iFish1); 
   SetIndexBuffer(4, Value1);
   SetIndexBuffer(5, MA1); 

   string name1=""+Pair1+" RVI "+RVI_Period1+" MA "+MA_Period1+"";
   string name2=""+Pair2+" RVI "+RVI_Period2+" MA "+MA_Period2+"";

   SetIndexLabel(0, name1); 
   SetIndexLabel(1, name2); 

   IndicatorShortName(" RVI FO: "+name1+";  "+name2+" "); 


   return(0); 
}  

int deinit() { return(0); } 


//+------------------------------------------------------------------+ 
//| Custom indicator iteration function | 
//+------------------------------------------------------------------+ 
int start() { 
   int counted_bars = IndicatorCounted(),ii, 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]=(10*iRVI(Pair1,0,RVI_Period1,RVI_line_mode1,i));
   for(i = limit; i >= 0; i--)    MA[i]=iMAOnArray(Value,0,MA_Period1,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);
  
   for(i = limit; i >= 0; i--)    Value1[i]=(10*iRVI(Pair2,0,RVI_Period2,RVI_line_mode2,i));
   for(i = limit; i >= 0; i--)    MA1[i]=iMAOnArray(Value1,0,MA_Period2,0,MA_Method,i);
   for(i = limit; i >= 0; i--)    iFish1[i]=(MathExp(2.0*MA1[i])-1.0)/(MathExp(2.0*MA1[i])+1.0);
        
   return(0); 
} 
//+------------------------------------------------------------------+

 

Comments