//+------------------------------------------------------------------+
//|                                                  SimplePanel.mq4 |
//|                   Copyright 2009-2014, MetaQuotes Software Corp. |
//|                                              http://www.mql4.com |
//+------------------------------------------------------------------+
#property copyright ""
#property link      ""
#property version   ""
#property strict

 

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 White
#property indicator_color2 White
#property strict

extern int SignalGap = 10;

int Gi_84 = 24;
double G_ibuf_88[];
double G_ibuf_92[];
int G_bars_96;
int G_count_100;
bool Gi_104;
bool Gi_108 = FALSE;
bool Gi_112 = FALSE;


int init() {
   SetIndexStyle(0, DRAW_ARROW, EMPTY,3);
   
    SetIndexStyle(1, DRAW_ARROW, EMPTY,3);
   SetIndexArrow(0, 234);
   SetIndexArrow(1, 233);
   SetIndexBuffer(0, G_ibuf_88);
   SetIndexBuffer(1, G_ibuf_92);
   G_bars_96 = Bars;
   G_count_100 = 0;
   




   return(INIT_SUCCEEDED);
}

void deinit() {
   Comment("");
}


int start() {
   string Ls_unused_0;
   int highest_8;
   int lowest_12;
   int Li_16 = IndicatorCounted();
   if (Li_16 < 0) return (-1);
   if (Li_16 > 0) Li_16--;
   int Li_20 = Bars - 1;
   if (Li_16 >= 1) Li_20 = Bars - Li_16 - 1;
   if (Li_20 < 0) Li_20 = 0;
   for (int Li_24 = Li_20; Li_24 >= 0; Li_24--) {
      highest_8 = iHighest(NULL, 0, MODE_HIGH, Gi_84, Li_24 - Gi_84 / 2);
      lowest_12 = iLowest(NULL, 0, MODE_LOW, Gi_84, Li_24 - Gi_84 / 2);
      if (Li_24 == highest_8 && Gi_108 == FALSE) {
         G_ibuf_88[Li_24] = High[highest_8] + SignalGap * Point;
         Gi_108 = TRUE;
         Gi_112 = FALSE;
      }
      if (Li_24 == lowest_12 && Gi_112 == FALSE) {
         G_ibuf_92[Li_24] = Low[lowest_12] - SignalGap * Point;
         Gi_112 = TRUE;
         Gi_108 = FALSE;
      }
   }
   Gi_104 = f0_1();
   if (Gi_104) G_count_100 = 0;
   if (G_count_100 == 0) {
    
   }
   return (0);
}

// 9B1AEE847CFB597942D106A4135D4FE6
int f0_1() {
   bool Li_ret_0 = FALSE;
   if (G_bars_96 != Bars) {
      Li_ret_0 = TRUE;
      G_bars_96 = Bars;
   }
   return (Li_ret_0);
}

// 945D754CB0DC06D04243FCBA25FC0802
string f0_0(int Ai_0) {
   if (Ai_0 >= 1) return ("M1");
   if (Ai_0 >= 5) return ("M5");
   if (Ai_0 >= 15) return ("M15");
   if (Ai_0 >= 30) return ("M30");
   if (Ai_0 >= 60) return ("H1");
   if (Ai_0 >= 240) return ("H4");
   if (Ai_0 >= 1440) return ("D1");
   if (Ai_0 >= 10080) return ("W1");
   if (Ai_0 >= 43200) return ("MN1");
   return ("");
}
/////////////////////////////////////// SECURITY  
 

////////////////////////////////////// SECURITY 