//+------------------------------------------------------------------+
//|                                   Momentum Pinball Indicator.mq4 |
//|                                                       FX Maratha |
//|  Free to use and modify for all aspiring and established traders |
//+------------------------------------------------------------------+
#property copyright "FX Maratha"
#property link      "Free to use and modify for all aspiring and established traders"

#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 RoyalBlue
//---- input parameters
extern int       ROC_Period=1;
extern int       RSI_Period=3;
//---- buffers
double ROC[];
double RSIonROC[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_NONE);
   SetIndexBuffer(0,ROC);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,RSIonROC);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    i;
   for(i=0;i<Bars;i++) ROC[i]=iClose(NULL,0,i)-iClose(NULL,0,i+ROC_Period);
   for(i=0;i<Bars;i++) RSIonROC[i]=iRSIOnArray(ROC,Bars,RSI_Period,i);
   return(0);
  }
//+------------------------------------------------------------------+