#property indicator_buffers 1
#property indicator_plots   1
//--- plot Line
#property indicator_label1  "Line"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrRed
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
//--- input parameters
input int   RSIPeriod=13;
input int   CciPeriod=21;
input int   MFIPeriod=13;
input int   WPRPeriod=55;
input int   DeMarkerPeriod=13;
input int   MomentumPeriod=10;
input int   MomPeriod   = 10;
input int   MomPrice    = PRICE_CLOSE;
input int   RSIPrice    = PRICE_CLOSE;
input int   CciPrice    = PRICE_TYPICAL;
input int   maxBars=1000;
//--- indicator buffers
double         LineBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,LineBuffer);
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
////---
//   int bars=Bars(Symbol(),0);
//   Print("Bars = ",bars,", rates_total = ",rates_total,",  prev_calculated = ",prev_calculated);
//   Print("time[0] = ",time[0]," time[rates_total-1] = ",time[rates_total-1]);
   
   
   int toCalc = MathMin(maxBars,rates_total-prev_calculated+1);
   for(int i=0;i<toCalc;i++)
   {
      double RSI;
      double CCI;
      double MFI;
      double WPR;
      double DeMarker;
      double Momentum;
      RSI = iRSI(NULL,0,RSIPeriod,RSIPrice,i);
      CCI = iCCI(NULL,0,CciPeriod,CciPrice,i);
      MFI = iMFI(NULL,0,MFIPeriod,i);
      WPR = iWPR(NULL,0,WPRPeriod,i);
      DeMarker = iDeMarker(NULL,0,DeMarkerPeriod,i);
      Momentum = iMomentum(NULL,0,MomPeriod,MomPrice,i);
      LineBuffer[i] = ((((CCI*3)+(RSI*15)+(DeMarker*150)+(MFI*10)+((WPR+100)*10))/(Momentum*75)-0.31415926)*100);
   }
   
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
