/*
   Generated by ex4-to-mq4 decompiler (forex-warez.com) 4.0.509.5
   Website:  W wW. f Ore x -WAr EZ . cOM
   E-mail : A n d R E yBBrv@G m AI L .CO m
*/
#property copyright "Chifbaw LLC, all rights reservers"
#property link      "www.chifbaw.com"

#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 Blue
#property indicator_color2 Pink
#property indicator_color3 Green
#property indicator_color4 Red

extern int period1 = 12;
extern int period2 = 26;
extern ENUM_MA_METHOD mamode = MODE_EMA;
extern ENUM_APPLIED_PRICE maprice = PRICE_CLOSE;


extern bool Email_alerts = FALSE;
extern bool Sound_alerts = FALSE;
extern int Number_of_Bars = 300;
double G_ibuf_88[];
double G_ibuf_92[];
double G_ibuf_96[];
double G_ibuf_100[];
int Gi_104 = 0;
datetime G_time_108 = 0;

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   SetIndexBuffer(0, G_ibuf_88);
   SetIndexStyle(0, DRAW_NONE, STYLE_SOLID, 2);
   SetIndexBuffer(1, G_ibuf_92);
   SetIndexStyle(1, DRAW_NONE, STYLE_DOT, 1);
   SetIndexBuffer(2, G_ibuf_96);
   SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID, 2);
   SetIndexBuffer(3, G_ibuf_100);
   SetIndexStyle(3, DRAW_HISTOGRAM, STYLE_SOLID, 2);
   return (0);
}

// 52D46093050F38C27267BCE42543EF60
int deinit() {
   return (0);
}

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   for (int Li_0 = Number_of_Bars; Li_0 >= 0; Li_0--) {
      G_ibuf_88[Li_0] = iMA(NULL, 0, period1, 0, mamode, maprice, Li_0) - iMA(NULL, 0, period2, 0, mamode, maprice, Li_0);
      if (G_ibuf_88[Li_0] > G_ibuf_88[Li_0 + 1]) G_ibuf_96[Li_0] = 100.0 * (G_ibuf_88[Li_0] - (G_ibuf_88[Li_0 + 1]));
      if (G_ibuf_88[Li_0] < G_ibuf_88[Li_0 + 1]) G_ibuf_100[Li_0] = 100.0 * (G_ibuf_88[Li_0] - (G_ibuf_88[Li_0 + 1]));
   }
   if (Time[0] <= G_time_108 && 1) return (0);
   G_time_108 = Time[0];
   if (Gi_104 <= 0) {
      if (G_ibuf_88[1] > G_ibuf_88[2] && G_ibuf_88[2] < G_ibuf_88[3]) {
         Gi_104 = 1;
         if (Email_alerts == TRUE) Alert("Chifbaw Oscillator Alert (", Symbol(), ", ", Period(), ")  -  Consider Buying!");
         if (Sound_alerts == TRUE) SendMail("Chifbaw Oscillator Alert", "Consider Buying " + Symbol() + "  " + Period());
      }
   }
   if (Gi_104 >= 0) {
      if (G_ibuf_88[1] < G_ibuf_88[2] && G_ibuf_88[2] > G_ibuf_88[3]) {
         Gi_104 = -1;
         if (Email_alerts == TRUE) Alert("Chifbaw Oscillator Alert (", Symbol(), ", ", Period(), ")  -  Consider Selling!");
         if (Sound_alerts == TRUE) SendMail("Chifbaw Oscillator Alert", "Consider Selling " + Symbol() + "  " + Period());
      }
   }
   return;
}
