Navigation´╝ÜHome > Content >

MAX_VininI_BB_MA_WPR(v1).mq4

Time: 2014-04-12 | Download file:MAX_VininI_BB_MA_WPR(v1).mq4

/*
   G e n e r a t e d  by ex4-to-mq4 decompiler FREEWARE 4.0.509.5
   Website:  h tT p: / / w W w. MEtAQU O te s. n ET
   E-mail : s Uppo R t@M eT AQu Ot Es .n Et
*/
#property copyright "Copyright 2008. Victor Nicolaev"
#property link      "vinin@mail.ru"

#property indicator_separate_window
#property indicator_minimum -100.0
#property indicator_maximum 100.0
#property indicator_buffers 4
#property indicator_color1 Lime
#property indicator_color2 Gold
#property indicator_color3 DodgerBlue
#property indicator_color4 DodgerBlue
#property indicator_level2 60.0
#property indicator_level3 -60.0

extern int WPR_Period = 55;
extern int MA_Period = 3;
extern int MA_Mode = 0;
extern int BB_Period = 55;
extern double BB_Div = 1.0;
extern int Limit = 1440;
double G_ibuf_104[];
double G_ibuf_108[];
double G_ibuf_112[];
double G_ibuf_116[];
double G_ibuf_120[];

int init() {
   IndicatorBuffers(5);
   SetIndexStyle(0, DRAW_LINE);
   SetIndexStyle(1, DRAW_LINE);
   SetIndexStyle(2, DRAW_LINE);
   SetIndexStyle(2, DRAW_LINE);
   SetIndexDrawBegin(0, WPR_Period + MA_Period + BB_Period);
   SetIndexBuffer(0, G_ibuf_120);
   SetIndexBuffer(1, G_ibuf_108);
   SetIndexBuffer(2, G_ibuf_112);
   SetIndexBuffer(3, G_ibuf_116);
   SetIndexBuffer(4, G_ibuf_104);
   IndicatorShortName("MA_WPR(" + WPR_Period + "," + MA_Period + ")");
   SetIndexLabel(0, "MA(WPR)");
   return (0);
}

int start() {
   double Ld_20;
   int Li_12 = IndicatorCounted();
   if (Li_12 < 0) return (-1);
   if (Li_12 > 0) Li_12--;
   int Li_0 = Bars - Li_12;
   if (Li_0 > Limit && Limit > 0) Li_0 = Limit;
   int Li_4 = Li_0;
   int Li_8 = Li_4;
   if (Li_12 == 0) {
      Li_8 = Li_0;
      Li_4 = Li_8 + BB_Period;
      Li_0 = Li_4 + MA_Period;
   }
   for (int Li_16 = Li_0; Li_16 >= 0; Li_16--) G_ibuf_104[Li_16] = 2.0 * (iWPR(Symbol(), Period(), WPR_Period, Li_16) + 50.0);
   for (Li_16 = Li_4; Li_16 >= 0; Li_16--) G_ibuf_120[Li_16] = iMAOnArray(G_ibuf_104, 0, MA_Period, 0, MA_Mode, Li_16);
   for (Li_16 = Li_8; Li_16 >= 0; Li_16--) {
      Ld_20 = (iBandsOnArray(G_ibuf_104, 0, BB_Period, 1, 0, 1, Li_16) - iBandsOnArray(G_ibuf_104, 0, BB_Period, 1, 0, 2, Li_16)) / 2.0;
      G_ibuf_108[Li_16] = iMAOnArray(G_ibuf_104, 0, BB_Period, 0, MODE_SMA, Li_16);
      G_ibuf_112[Li_16] = G_ibuf_108[Li_16] + BB_Div * Ld_20;
      G_ibuf_116[Li_16] = G_ibuf_108[Li_16] - BB_Div * Ld_20;
   }
   return (0);
}

Recommend