Navigation:Home > Content >

VininI_RSI_FO_2m.mq4

Time: 2015-05-02 | Download file:VininI_RSI_FO_2m.mq4

//+------------------------------------------------------------------+
//|                                              VininI_RSI_FO_2.mq4 |
//+------------------------------------------------------------------+
//|                                                     VininI_Cyber |
//|                                Copyright © 2009, Victor Nicolaev |
//|                                            e-mail: [email protected] |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, Victor Nicolaev"
#property link      "e-mail: [email protected]"

#property indicator_separate_window
#property indicator_buffers 2

#property indicator_color1 Blue
#property indicator_color2 LimeGreen
#property indicator_color3 Red
#property indicator_color4 Blue
#property indicator_color5 LimeGreen
#property indicator_color6 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  RSI_Period  =5;
extern int  RSI_Period1 =5;
extern int  RSI_Price =0;
extern int  MA_Period1 =5;
extern int  MA_Period2 =9;
extern int  MA_Method =3;
extern string  pair1 ;
extern string  pair2 ;

//---- buffers 

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



//+------------------------------------------------------------------+ 
//| Custom indicator initialization function | 
//+------------------------------------------------------------------+ 
int init() { 
    IndicatorBuffers(8);
    SetIndexStyle(0,DRAW_LINE); 
   SetIndexBuffer(0, iFish1); 
   SetIndexBuffer(3, Value);
   SetIndexBuffer(2, MA);  
     SetIndexStyle(1,DRAW_LINE); 
   SetIndexBuffer(1, iFish); 
   SetIndexBuffer(4, Value1);
   SetIndexBuffer(5, MA1); 


IndicatorShortName("Vinin RSI FO "+pair1+","+pair2+" ; rsi "+RSI_Period+" , "+RSI_Period1+" "); 
   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]=0.1*(iRSI(pair1,0,RSI_Period,RSI_Price,i)-50.0);
   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]=0.1*(iRSI(pair2,0,RSI_Period,RSI_Price,i)-50.0);
   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); 
} 
//+------------------------------------------------------------------+

 

Recommend