/*
   Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "Freedom Investment Group Inc."
#property link      "http://www.ForexStrategySecrets.com/"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red

int g_period_76 = 3;
int gi_80 = 0;
int g_ma_method_84 = MODE_SMA;
int g_applied_price_88 = PRICE_CLOSE;
int g_period_92 = 5;
int gi_96 = 1;
int g_ma_method_100 = MODE_SMA;
int g_applied_price_104 = PRICE_CLOSE;
int g_period_108 = 12;
int g_period_112 = 26;
int g_period_116 = 9;
int g_applied_price_120 = PRICE_CLOSE;
double g_ibuf_124[];
double g_ibuf_128[];
//int gi_132 = 0;

int init()
{

   
   SetIndexBuffer(0, g_ibuf_124);
   SetIndexStyle(0, DRAW_ARROW);
   SetIndexArrow(0, 217);
   SetIndexEmptyValue(0, EMPTY_VALUE);
   SetIndexBuffer(1, g_ibuf_128);
   SetIndexStyle(1, DRAW_ARROW);
   SetIndexArrow(1, 218);
   SetIndexEmptyValue(1, EMPTY_VALUE);
   return (0);
}

int deinit() {
   Comment("                                              \n                                                     ");
   return (0);
}

int start() {
   double l_ima_4;
   double l_ima_12;
   double l_ima_20;
   double l_ima_28;
   double l_iosma_36;
   double l_iosma_44;

   int li_0 = IndicatorCounted();
   if (li_0 < 0) return (0);
   for (li_0 = Bars - li_0; li_0 >= 0; li_0--) {
      l_ima_4 = iMA(NULL, 0, g_period_76, gi_80, g_ma_method_84, g_applied_price_88, li_0 + 0);
      l_ima_12 = iMA(NULL, 0, g_period_76, gi_80, g_ma_method_84, g_applied_price_88, li_0 + 1);
      l_ima_20 = iMA(NULL, 0, g_period_92, gi_96, g_ma_method_100, g_applied_price_104, li_0 + 0);
      l_ima_28 = iMA(NULL, 0, g_period_92, gi_96, g_ma_method_100, g_applied_price_104, li_0 + 1);
      l_iosma_36 = iOsMA(NULL, 0, g_period_108, g_period_112, g_period_116, g_applied_price_120, li_0 + 0);
      l_iosma_44 = iOsMA(NULL, 0, g_period_108, g_period_112, g_period_116, g_applied_price_120, li_0 + 1);
      if (l_iosma_36 > 0.0 && l_ima_4 > l_ima_20 && l_iosma_44 < 0.0 || l_ima_12 < l_ima_28) g_ibuf_124[li_0] = High[li_0];
      else g_ibuf_124[li_0] = EMPTY_VALUE;
      if (l_iosma_36 < 0.0 && l_ima_4 < l_ima_20 && l_iosma_44 > 0.0 || l_ima_12 > l_ima_28) g_ibuf_128[li_0] = Low[li_0];
      else g_ibuf_128[li_0] = EMPTY_VALUE;
   }
   return (0);
}