#property copyright "Web Crossover"
#property link      "Web Crossover"

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Aqua
#property indicator_color2 Magenta
#property indicator_color3 Aqua
#property indicator_color4 Magenta

extern int MA1Period = 8;
extern int MA1Method = 3;
extern int MA1Price = 5;
extern int MA2Period = 11;
extern int MA2Method = 3;
extern int MA2Price = 5;
double g_ibuf_100[];
double g_ibuf_104[];
double g_ibuf_108[];
double g_ibuf_112[];

int init() {
   SetIndexBuffer(0, g_ibuf_108);
   SetIndexStyle(0, DRAW_HISTOGRAM);
   SetIndexBuffer(1, g_ibuf_112);
   SetIndexStyle(1, DRAW_HISTOGRAM);
   SetIndexBuffer(2, g_ibuf_100);
   SetIndexBuffer(3, g_ibuf_104);
   return (0);
}

int deinit() {
   return (0);
}

int start() {
   int li_0 = IndicatorCounted();
   if (li_0 < 0) return (-1);
   if (li_0 > 0) li_0--;
   int li_4 = Bars - li_0;
   for (int li_8 = li_4; li_8 >= 0; li_8--) {
      g_ibuf_100[li_8] = iMA(NULL, 0, MA1Period, 0, MA1Method, MA1Price, li_8);
      g_ibuf_104[li_8] = iMA(NULL, 0, MA2Period, 1, MA2Method, MA2Price, li_8);
      g_ibuf_108[li_8] = g_ibuf_100[li_8];
      g_ibuf_112[li_8] = g_ibuf_104[li_8];
   }

}