/*
   Generated by EX4-TO-MQ4 decompiler V4.0.220.2 []
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "Copyright © 2007"
#property link      "http://www.metaquotes.net"

#property indicator_separate_window
#property indicator_minimum -0.05
#property indicator_maximum 1.05
#property indicator_buffers 7
#property indicator_color1 Aqua
#property indicator_color2 LawnGreen
#property indicator_color3 LimeGreen
#property indicator_color4 Yellow
#property indicator_color5 SaddleBrown
#property indicator_color6 OrangeRed
#property indicator_color7 Orange

extern int NumBars = 1000;
double gda_80[];
double gda_84[];
double gda_88[];
double gda_92[];
double gda_96[];
double gda_100[];
double gda_104[];

int init() {
   SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 3, Aqua);
   SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 3, LawnGreen);
   SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID, 3, LimeGreen);
   SetIndexStyle(3, DRAW_HISTOGRAM, STYLE_SOLID, 3, Yellow);
   SetIndexStyle(4, DRAW_HISTOGRAM, STYLE_SOLID, 3, SaddleBrown);
   SetIndexStyle(5, DRAW_HISTOGRAM, STYLE_SOLID, 3, OrangeRed);
   SetIndexStyle(6, DRAW_HISTOGRAM, STYLE_SOLID, 3, Orange);
   SetIndexBuffer(0, gda_80);
   SetIndexBuffer(1, gda_84);
   SetIndexBuffer(2, gda_88);
   SetIndexBuffer(3, gda_92);
   SetIndexBuffer(4, gda_96);
   SetIndexBuffer(5, gda_100);
   SetIndexBuffer(6, gda_104);
   IndicatorShortName("CZI_Heart_v1");
   SetIndexLabel(0, "Strong UpTrend / ZLR long OK");
   SetIndexLabel(1, "Retrace UpTrend");
   SetIndexLabel(2, "Choppy UpTrend");
   SetIndexLabel(3, "Flat Trend");
   SetIndexLabel(4, "Strong DownTrend / ZLR short OK");
   SetIndexLabel(5, "Retrace DownTrend");
   SetIndexLabel(6, "Choppy DownTrend");
   return (0);
}

int start() {
   double ld_4;
   double ld_12;
   for (int li_0 = Bars; li_0 >= 0; li_0--) {
      gda_80[li_0] = 0.0;
      gda_84[li_0] = 0.0;
      gda_88[li_0] = 0.0;
      gda_92[li_0] = 0.0;
      gda_96[li_0] = 0.0;
      gda_100[li_0] = 0.0;
      gda_104[li_0] = 0.0;
   }
   for (int li_20 = NumBars; li_20 >= 0; li_20--) {
      ld_4 = iMA(Symbol(), Period(), 34, 0, MODE_EMA, PRICE_CLOSE, li_20);
      ld_12 = iClose(Symbol(), Period(), li_20);
      if (ld_12 / ld_4 > 1.00015) {
         gda_80[li_20] = 1.0;
         gda_84[li_20] = 0.0;
         gda_88[li_20] = 0.0;
         gda_92[li_20] = 0.0;
         gda_96[li_20] = 0.0;
         gda_100[li_20] = 0.0;
         gda_104[li_20] = 0.0;
      }
      if (ld_12 / ld_4 > 1.0001 && ld_12 / ld_4 <= 1.00015) {
         gda_80[li_20] = 0.0;
         gda_84[li_20] = 1.0;
         gda_88[li_20] = 0.0;
         gda_92[li_20] = 0.0;
         gda_96[li_20] = 0.0;
         gda_100[li_20] = 0.0;
         gda_104[li_20] = 0.0;
      }
      if (ld_12 / ld_4 > 1.0 && ld_12 / ld_4 <= 1.0001) {
         gda_80[li_20] = 0.0;
         gda_84[li_20] = 0.0;
         gda_88[li_20] = 1.0;
         gda_92[li_20] = 0.0;
         gda_96[li_20] = 0.0;
         gda_100[li_20] = 0.0;
         gda_104[li_20] = 0.0;
      }
      if (ld_12 / ld_4 > 0.99992 && ld_12 / ld_4 <= 1.0) {
         gda_80[li_20] = 0.0;
         gda_84[li_20] = 0.0;
         gda_88[li_20] = 0.0;
         gda_92[li_20] = 1.0;
         gda_96[li_20] = 0.0;
         gda_100[li_20] = 0.0;
         gda_104[li_20] = 0.0;
      }
      if (ld_12 / ld_4 < 0.9997) {
         gda_80[li_20] = 0.0;
         gda_84[li_20] = 0.0;
         gda_88[li_20] = 0.0;
         gda_92[li_20] = 0.0;
         gda_96[li_20] = 1.0;
         gda_100[li_20] = 0.0;
         gda_104[li_20] = 0.0;
      }
      if (ld_12 / ld_4 < 0.99985 && ld_12 / ld_4 >= 0.9997) {
         gda_80[li_20] = 0.0;
         gda_84[li_20] = 0.0;
         gda_88[li_20] = 0.0;
         gda_92[li_20] = 0.0;
         gda_96[li_20] = 0.0;
         gda_100[li_20] = 1.0;
         gda_104[li_20] = 0.0;
      }
      if (ld_12 / ld_4 < 0.99992 && ld_12 / ld_4 >= 0.99985) {
         gda_80[li_20] = 0.0;
         gda_84[li_20] = 0.0;
         gda_88[li_20] = 0.0;
         gda_92[li_20] = 0.0;
         gda_96[li_20] = 0.0;
         gda_100[li_20] = 0.0;
         gda_104[li_20] = 1.0;
      }
   }
   return (0);
}
