ytg_Def_RSI





//+------------------------------------------------------------------+
//|                                                  ytg_Def_RSI.mq4 |
//|                                                     Yuriy Tokman |
//|                                            yuriytokman@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Yuriy Tokman"
#property link      "yuriytokman@gmail.com"

#property indicator_separate_window

#property  indicator_buffers 2
#property  indicator_color1  Green
#property indicator_level1 0

extern int RSI_1_Period  = 14;//ïåðèîä ïåðâîãî èíäèêàòîðà ÐÑÈ
extern int RSI_2_Period  = 28;//ïåðèîä âòîðîãî èíäèêàòîðà ÐÑÈ
extern int applied_price = 0;//èñïîëüçóåìàÿ öåíà  0-6
extern int ma_period     = 14;//ïåðèîä ñãëàæèâàíèÿ
extern int ma_method     = 0;//ìåòîä ñãëàæèâàíèÿ  0-3

double   buf[];
double   MA_buf[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);
   SetIndexBuffer(0, buf);
   
   SetIndexStyle(1,DRAW_NONE);
   SetIndexBuffer(1,MA_buf);   
   
   IndicatorShortName("ytg_Def_RSI");
   Comment("yuriytokman@gmail.com");   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   Comment("");  
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
//----
   double RSI_1,RSI_2;
   
   int limit;
   int counted_bars=IndicatorCounted();
   
   if(counted_bars<0) return(-1);

   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;

   for(int i=limit; i>=0; i--)
   {
     RSI_1 = iRSI(NULL,0,RSI_1_Period,applied_price,i);
     RSI_2 = iRSI(NULL,0,RSI_2_Period,applied_price,i);

     MA_buf[i] = (RSI_1-RSI_2);
   }
   for(i=limit; i>=0; i--)
   {
     buf[i] = iMAOnArray(MA_buf,0,ma_period,0,ma_method,i);
   }   
   
   
//----
   return(0);
  }
//+------------------------------------------------------------------+



Sample





Analysis



Market Information Used:



Indicator Curves created:

Implements a curve of type DRAW_LINE

Implements a curve of type DRAW_NONE

Indicators Used:

Relative strength index
Moving average indicator


Custom Indicators Used:

Order Management characteristics:

Other Features: