/*
   Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "Mahmoud Amer, Copyright © 2011"
#property link      "pisces7644@hotmail.com"

#property indicator_chart_window
#property indicator_buffers 7
#property indicator_color1 Chartreuse
#property indicator_color2 Red
#property indicator_color3 DarkOrange
#property indicator_color4 DarkOrange
#property indicator_color5 DarkOrange
#property indicator_color6 DarkOrange
#property indicator_color7 DarkOrange

extern bool Show.Middle = TRUE;
extern color Middle.Color = DarkOrange;
extern bool ShowPercent = TRUE;
extern bool Show.Positive = TRUE;
extern color Positive.Color = Aqua;
extern int Positive.Size = 2;
extern bool Show.Negative = TRUE;
extern color Negative.Color = OrangeRed;
extern int Negative.Size = 2;
double g_ibuf_112[];
double g_ibuf_116[];
double g_ibuf_120[];
double g_ibuf_124[];
double g_ibuf_128[];
double g_ibuf_132[];
double g_ibuf_136[];
extern string Period_info = "M1=1    M5=5    M15=15    M30=30    H1=60    H4=240    D1=1440    W1=10080    MN1=43200";
extern int MyPeriod = 43200;
double gd_152;
double g_ihigh_160;
double g_ilow_168;
double gd_176;
int gi_184 = 1;
int gi_188 = 1;
string gs_192;

int init() {
   SetIndexBuffer(0, g_ibuf_112);
   SetIndexBuffer(1, g_ibuf_116);
   SetIndexBuffer(2, g_ibuf_120);
   SetIndexBuffer(3, g_ibuf_124);
   SetIndexBuffer(4, g_ibuf_128);
   SetIndexBuffer(5, g_ibuf_132);
   SetIndexBuffer(6, g_ibuf_136);
   SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 3, Middle.Color);
   SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 3, Middle.Color);
   SetIndexStyle(2, DRAW_LINE, STYLE_SOLID, 1, Middle.Color);
   SetIndexStyle(3, DRAW_LINE, STYLE_SOLID, 1, Middle.Color);
   SetIndexStyle(4, DRAW_LINE, STYLE_SOLID, 1, Middle.Color);
   SetIndexStyle(5, DRAW_LINE, STYLE_SOLID, 1, Middle.Color);
   SetIndexStyle(6, DRAW_LINE, STYLE_SOLID, 1, Middle.Color);
   gs_192 = name2();
   if (MyPeriod == PERIOD_MN1) {
      gi_184 = TRUE;
      gi_188 = 5;
   }
   if (MyPeriod == PERIOD_W1) {
      gi_184 = TRUE;
      gi_188 = 30;
   }
   if (MyPeriod == PERIOD_D1) {
      gi_184 = TRUE;
      gi_188 = 55;
   }
   if (MyPeriod == PERIOD_H4) {
      gi_184 = TRUE;
      gi_188 = 80;
   }
   if (MyPeriod == PERIOD_H1) {
      gi_184 = TRUE;
      gi_188 = 105;
   }
   if (MyPeriod == PERIOD_M30) {
      gi_184 = TRUE;
      gi_188 = 130;
   }
   if (MyPeriod == PERIOD_M15) {
      gi_184 = TRUE;
      gi_188 = 155;
   }
   if (MyPeriod == PERIOD_M5) {
      gi_184 = TRUE;
      gi_188 = 180;
   }
   if (MyPeriod == PERIOD_M1) {
      gi_184 = TRUE;
      gi_188 = 205;
   }
   delete_obj();
   return (0);
}

int deinit() {
   delete_obj();
   Comment("");
   return (0);
}

int start() {
   int l_shift_4;
   delete_obj();
   int li_8 = IndicatorCounted();
   if (li_8 < 0) return (-1);
   if (li_8 > 0) li_8--;
   int li_12 = Bars - li_8;
   for (int li_0 = li_12 - 1; li_0 >= 0; li_0--) {
      l_shift_4 = iBarShift(Symbol(), MyPeriod, Time[li_0], FALSE);
      g_ihigh_160 = iHigh(Symbol(), MyPeriod, l_shift_4 + 1);
      g_ilow_168 = iLow(Symbol(), MyPeriod, l_shift_4 + 1);
      gd_152 = g_ihigh_160 - g_ilow_168;
      if (Show.Middle == TRUE) {
         g_ibuf_112[li_0] = g_ihigh_160;
         SetPrice(gs_192 + "m1", Time[li_0], g_ihigh_160, Middle.Color);
         SetText("txt" + gs_192 + "m1", gs_192 + " High                   ", Time[li_0], g_ihigh_160, Blue);
         g_ibuf_116[li_0] = g_ilow_168;
         SetPrice(gs_192 + "m2", Time[li_0], g_ilow_168, Middle.Color);
         SetText("txt" + gs_192 + "m2", gs_192 + " Low", Time[li_0], g_ilow_168, Red);
         g_ibuf_120[li_0] = g_ilow_168 + 0.236 * gd_152;
         SetPrice(gs_192 + "m3", Time[li_0], g_ilow_168 + 0.236 * gd_152, Middle.Color);
         SetText("txt" + gs_192 + "m3", gs_192 + " 23.6%", Time[li_0], g_ilow_168 + 0.236 * gd_152, Middle.Color);
         g_ibuf_124[li_0] = g_ilow_168 + 0.382 * gd_152;
         SetPrice(gs_192 + "m4", Time[li_0], g_ilow_168 + 0.382 * gd_152, Middle.Color);
         SetText("txt" + gs_192 + "m4", gs_192 + " 38.2%", Time[li_0], g_ilow_168 + 0.382 * gd_152, Middle.Color);
         g_ibuf_128[li_0] = g_ilow_168 + 0.500 * gd_152;
         SetPrice(gs_192 + "m5", Time[li_0], g_ilow_168 + 0.500 * gd_152, Middle.Color);
         SetText("txt" + gs_192 + "m5", gs_192 + " 50.0%", Time[li_0], g_ilow_168 + 0.50 * gd_152, Middle.Color);
         g_ibuf_132[li_0] = g_ilow_168 + 0.618 * gd_152;
         SetPrice(gs_192 + "m6", Time[li_0], g_ilow_168 + 0.618 * gd_152, Middle.Color);
         SetText("txt" + gs_192 + "m6", gs_192 + " 61.8%", Time[li_0], g_ilow_168 + 0.618 * gd_152, Middle.Color);
         g_ibuf_136[li_0] = g_ilow_168 + 0.764 * gd_152;
         SetPrice(gs_192 + "m7", Time[li_0], g_ilow_168 + 0.764 * gd_152, Middle.Color);
         SetText("txt" + gs_192 + "m7", gs_192 + " 76.4%", Time[li_0], g_ilow_168 + 0.764 * gd_152, Middle.Color);
      }
   }
   int li_16 = iBars(Symbol(), 0) - 2;
   li_0 = 0;
   l_shift_4 = iBarShift(Symbol(), MyPeriod, Time[li_0], FALSE);
   g_ihigh_160 = iHigh(Symbol(), MyPeriod, l_shift_4 + 1);
   g_ilow_168 = iLow(Symbol(), MyPeriod, l_shift_4 + 1);
   gd_152 = g_ihigh_160 - g_ilow_168;
   if (Show.Negative == TRUE) {
      line("n1" + gs_192, g_ilow_168 - gd_152 / 8.0, Time[li_16], Time[li_0], Negative.Color, Negative.Size);
      SetPrice(gs_192 + "n1", Time[li_0], g_ilow_168 - gd_152 / 8.0, Negative.Color);
      SetText("txt" + gs_192 + "n1", gs_192 + " -12.5%", Time[li_0], g_ilow_168 - gd_152 / 8.0, Negative.Color);
      line("n2" + gs_192, g_ilow_168 - 0.236 * gd_152, Time[li_16], Time[li_0], Negative.Color, Negative.Size);
      SetPrice(gs_192 + "n2", Time[li_0], g_ilow_168 - 0.236 * gd_152, Negative.Color);
      SetText("txt" + gs_192 + "n2", gs_192 + " -23.6%", Time[li_0], g_ilow_168 - 0.236 * gd_152, Negative.Color);
      line("n3" + gs_192, g_ilow_168 - 0.382 * gd_152, Time[li_16], Time[li_0], Negative.Color, Negative.Size);
      SetPrice(gs_192 + "n3", Time[li_0], g_ilow_168 - 0.382 * gd_152, Negative.Color);
      SetText("txt" + gs_192 + "n3", gs_192 + " -38.2%", Time[li_0], g_ilow_168 - 0.382 * gd_152, Negative.Color);
      line("n4" + gs_192, g_ilow_168 - 0.500 * gd_152, Time[li_16], Time[li_0], Negative.Color, Negative.Size);
      SetPrice(gs_192 + "n4", Time[li_0], g_ilow_168 - 0.500 * gd_152, Negative.Color);
      SetText("txt" + gs_192 + "n4", gs_192 + " -50%", Time[li_0], g_ilow_168 - 0.500 * gd_152, Negative.Color);
      line("n5" + gs_192, g_ilow_168 - 0.618 * gd_152, Time[li_16], Time[li_0], Negative.Color, Negative.Size);
      SetPrice(gs_192 + "n5", Time[li_0], g_ilow_168 - 0.618 * gd_152, Negative.Color);
      SetText("txt" + gs_192 + "n5", gs_192 + " -61.8%", Time[li_0], g_ilow_168 - 0.618 * gd_152, Negative.Color);
      line("n6" + gs_192, g_ilow_168 - 0.764 * gd_152, Time[li_16], Time[li_0], Negative.Color, Negative.Size);
      SetPrice(gs_192 + "n6", Time[li_0], g_ilow_168 - 0.764 * gd_152, Negative.Color);
      SetText("txt" + gs_192 + "n6", gs_192 + " -76.4%", Time[li_0], g_ilow_168 - 0.764 * gd_152, Negative.Color);
      line("n7" + gs_192, g_ilow_168 - 1.0 * gd_152, Time[li_16], Time[li_0], Negative.Color, Negative.Size);
      SetPrice(gs_192 + "n7", Time[li_0], g_ilow_168 - 1.0 * gd_152, Negative.Color);
      SetText("txt" + gs_192 + "n7", gs_192 + " -100%", Time[li_0], g_ilow_168 - 1.0 * gd_152, Negative.Color);
      line("n8" + gs_192, g_ilow_168 - 1.236 * gd_152, Time[li_16], Time[li_0], Negative.Color, Negative.Size);
      SetPrice(gs_192 + "n8", Time[li_0], g_ilow_168 - 1.236 * gd_152, Negative.Color);
      SetText("txt" + gs_192 + "n8", gs_192 + " -123.6%", Time[li_0], g_ilow_168 - 1.236 * gd_152, Negative.Color);
      line("n9" + gs_192, g_ilow_168 - 1.382 * gd_152, Time[li_16], Time[li_0], Negative.Color, Negative.Size);
      SetPrice(gs_192 + "n9", Time[li_0], g_ilow_168 - 1.382 * gd_152, Negative.Color);
      SetText("txt" + gs_192 + "n9", gs_192 + " -138.2%", Time[li_0], g_ilow_168 - 1.382 * gd_152, Negative.Color);
      line("n10" + gs_192, g_ilow_168 - 1.5 * gd_152, Time[li_16], Time[li_0], Negative.Color, Negative.Size);
      SetPrice(gs_192 + "n10", Time[li_0], g_ilow_168 - 1.5 * gd_152, Negative.Color);
      SetText("txt" + gs_192 + "n10", gs_192 + " -150%", Time[li_0], g_ilow_168 - 1.5 * gd_152, Negative.Color);
      line("n11" + gs_192, g_ilow_168 - 1.618 * gd_152, Time[li_16], Time[li_0], Negative.Color, Negative.Size);
      SetPrice(gs_192 + "n11", Time[li_0], g_ilow_168 - 1.618 * gd_152, Negative.Color);
      SetText("txt" + gs_192 + "n11", gs_192 + " -161.8%", Time[li_0], g_ilow_168 - 1.618 * gd_152, Negative.Color);
      line("n12" + gs_192, g_ilow_168 - 2.0 * gd_152, Time[li_16], Time[li_0], Negative.Color, Negative.Size);
      SetPrice(gs_192 + "n12", Time[li_0], g_ilow_168 - 2.0 * gd_152, Negative.Color);
      SetText("txt" + gs_192 + "n12", gs_192 + " -200%", Time[li_0], g_ilow_168 - 2.0 * gd_152, Negative.Color);
      line("n13" + gs_192, g_ilow_168 - 2.382 * gd_152, Time[li_16], Time[li_0], Negative.Color, Negative.Size);
      SetPrice(gs_192 + "n13", Time[li_0], g_ilow_168 - 2.382 * gd_152, Negative.Color);
      SetText("txt" + gs_192 + "n13", gs_192 + " -238.2%", Time[li_0], g_ilow_168 - 2.382 * gd_152, Negative.Color);
      line("n14" + gs_192, g_ilow_168 - 2.5 * gd_152, Time[li_16], Time[li_0], Negative.Color, Negative.Size);
      SetPrice(gs_192 + "n14", Time[li_0], g_ilow_168 - 2.5 * gd_152, Negative.Color);
      SetText("txt" + gs_192 + "n14", gs_192 + " -250%", Time[li_0], g_ilow_168 - 2.5 * gd_152, Negative.Color);
      line("n15" + gs_192, g_ilow_168 - 2.618 * gd_152, Time[li_16], Time[li_0], Negative.Color, Negative.Size);
      SetPrice(gs_192 + "n15", Time[li_0], g_ilow_168 - 2.618 * gd_152, Negative.Color);
      SetText("txt" + gs_192 + "n15", gs_192 + " -261.8%", Time[li_0], g_ilow_168 - 2.618 * gd_152, Negative.Color);
      line("n16" + gs_192, g_ilow_168 - 3.0 * gd_152, Time[li_16], Time[li_0], Negative.Color, Negative.Size);
      SetPrice(gs_192 + "n16", Time[li_0], g_ilow_168 - 3.0 * gd_152, Negative.Color);
      SetText("txt" + gs_192 + "n16", gs_192 + " -300%", Time[li_0], g_ilow_168 - 3.0 * gd_152, Negative.Color);
   }
   if (Show.Positive == TRUE) {
      line("p1" + gs_192, g_ihigh_160 + gd_152 / 8.0, Time[li_16], Time[li_0], Positive.Color, Positive.Size);
      SetPrice(gs_192 + "p1", Time[li_0], g_ihigh_160 + gd_152 / 8.0, Positive.Color);
      SetText("txt" + gs_192 + "p1", gs_192 + " 112.5%", Time[li_0], g_ihigh_160 + gd_152 / 8.0, Positive.Color);
      line("p2" + gs_192, g_ihigh_160 + 0.236 * gd_152, Time[li_16], Time[li_0], Positive.Color, Positive.Size);
      SetPrice(gs_192 + "p2", Time[li_0], g_ihigh_160 + 0.236 * gd_152, Positive.Color);
      SetText("txt" + gs_192 + "p2", gs_192 + " 123.6%", Time[li_0], g_ihigh_160 + 0.236 * gd_152, Positive.Color);
      line("p3" + gs_192, g_ihigh_160 + 0.382 * gd_152, Time[li_16], Time[li_0], Positive.Color, Positive.Size);
      SetPrice(gs_192 + "p3", Time[li_0], g_ihigh_160 + 0.382 * gd_152, Positive.Color);
      SetText("txt" + gs_192 + "p3", gs_192 + " 138.2%", Time[li_0], g_ihigh_160 + 0.382 * gd_152, Positive.Color);
      line("p4" + gs_192, g_ihigh_160 + 0.500 * gd_152, Time[li_16], Time[li_0], Positive.Color, Positive.Size);
      SetPrice(gs_192 + "p4", Time[li_0], g_ihigh_160 + 0.500 * gd_152, Positive.Color);
      SetText("txt" + gs_192 + "p4", gs_192 + " 150%", Time[li_0], g_ihigh_160 + 0.500 * gd_152, Positive.Color);
      line("p5" + gs_192, g_ihigh_160 + 0.618 * gd_152, Time[li_16], Time[li_0], Positive.Color, Positive.Size);
      SetPrice(gs_192 + "p5", Time[li_0], g_ihigh_160 + 0.618 * gd_152, Positive.Color);
      SetText("txt" + gs_192 + "p5", gs_192 + " 161.8%", Time[li_0], g_ihigh_160 + 0.618 * gd_152, Positive.Color);
      line("p6" + gs_192, g_ihigh_160 + 0.764 * gd_152, Time[li_16], Time[li_0], Positive.Color, Positive.Size);
      SetPrice(gs_192 + "p6", Time[li_0], g_ihigh_160 + 0.764 * gd_152, Positive.Color);
      SetText("txt" + gs_192 + "p6", gs_192 + " 176.4%", Time[li_0], g_ihigh_160 + 0.764 * gd_152, Positive.Color);
      line("p7" + gs_192, g_ihigh_160 + 1.0 * gd_152, Time[li_16], Time[li_0], Positive.Color, Positive.Size);
      SetPrice(gs_192 + "p7", Time[li_0], g_ihigh_160 + 1.0 * gd_152, Positive.Color);
      SetText("txt" + gs_192 + "p7", gs_192 + " 200%", Time[li_0], g_ihigh_160 + 1.0 * gd_152, Positive.Color);
      line("p8" + gs_192, g_ihigh_160 + 1.236 * gd_152, Time[li_16], Time[li_0], Positive.Color, Positive.Size);
      SetPrice(gs_192 + "p8", Time[li_0], g_ihigh_160 + 1.236 * gd_152, Positive.Color);
      SetText("txt" + gs_192 + "p8", gs_192 + " 223.6%", Time[li_0], g_ihigh_160 + 1.236 * gd_152, Positive.Color);
      line("p9" + gs_192, g_ihigh_160 + 1.382 * gd_152, Time[li_16], Time[li_0], Positive.Color, Positive.Size);
      SetPrice(gs_192 + "p9", Time[li_0], g_ihigh_160 + 1.382 * gd_152, Positive.Color);
      SetText("txt" + gs_192 + "p9", gs_192 + " 238.2%", Time[li_0], g_ihigh_160 + 1.382 * gd_152, Positive.Color);
      line("p10" + gs_192, g_ihigh_160 + 1.5 * gd_152, Time[li_16], Time[li_0], Positive.Color, Positive.Size);
      SetPrice(gs_192 + "p10", Time[li_0], g_ihigh_160 + 1.5 * gd_152, Positive.Color);
      SetText("txt" + gs_192 + "p10", gs_192 + " 250%", Time[li_0], g_ihigh_160 + 1.5 * gd_152, Positive.Color);
      line("p11" + gs_192, g_ihigh_160 + 1.618 * gd_152, Time[li_16], Time[li_0], Positive.Color, Positive.Size);
      SetPrice(gs_192 + "p11", Time[li_0], g_ihigh_160 + 1.618 * gd_152, Positive.Color);
      SetText("txt" + gs_192 + "p11", gs_192 + " 261.8%", Time[li_0], g_ihigh_160 + 1.618 * gd_152, Positive.Color);
      line("p12" + gs_192, g_ihigh_160 + 2.0 * gd_152, Time[li_16], Time[li_0], Positive.Color, Positive.Size);
      SetPrice(gs_192 + "p12", Time[li_0], g_ihigh_160 + 2.0 * gd_152, Positive.Color);
      SetText("txt" + gs_192 + "p12", gs_192 + " 300%", Time[li_0], g_ihigh_160 + 2.0 * gd_152, Positive.Color);
   }
   gd_176 = 100.0 * ((Bid - g_ilow_168) / gd_152);
   if (ShowPercent == TRUE) SetLabel(gs_192 + "Percent", gs_192 + " Fibo=" + DoubleToStr(gd_176, 2) + "%", gi_184, gi_188, "Simplified Arabic Fixed", 12, 0, Middle.Color);
   else ObjectDelete(gs_192 + "Percent");
   return (0);
}

void delete_obj() {
   ObjectDelete(gs_192 + "m1");
   ObjectDelete("txt" + gs_192 + "m1");
   ObjectDelete(gs_192 + "m2");
   ObjectDelete("txt" + gs_192 + "m2");
   ObjectDelete(gs_192 + "m3");
   ObjectDelete("txt" + gs_192 + "m3");
   ObjectDelete(gs_192 + "m4");
   ObjectDelete("txt" + gs_192 + "m4");
   ObjectDelete(gs_192 + "m5");
   ObjectDelete("txt" + gs_192 + "m5");
   ObjectDelete(gs_192 + "m6");
   ObjectDelete("txt" + gs_192 + "m6");
   ObjectDelete(gs_192 + "m7");
   ObjectDelete("txt" + gs_192 + "m7");
   ObjectDelete("n1" + gs_192);
   ObjectDelete(gs_192 + "n1");
   ObjectDelete("txt" + gs_192 + "n1");
   ObjectDelete("n2" + gs_192);
   ObjectDelete(gs_192 + "n2");
   ObjectDelete("txt" + gs_192 + "n2");
   ObjectDelete("n3" + gs_192);
   ObjectDelete(gs_192 + "n3");
   ObjectDelete("txt" + gs_192 + "n3");
   ObjectDelete("n4" + gs_192);
   ObjectDelete(gs_192 + "n4");
   ObjectDelete("txt" + gs_192 + "n4");
   ObjectDelete("n5" + gs_192);
   ObjectDelete(gs_192 + "n5");
   ObjectDelete("txt" + gs_192 + "n5");
   ObjectDelete("n6" + gs_192);
   ObjectDelete(gs_192 + "n6");
   ObjectDelete("txt" + gs_192 + "n6");
   ObjectDelete("n7" + gs_192);
   ObjectDelete(gs_192 + "n7");
   ObjectDelete("txt" + gs_192 + "n7");
   ObjectDelete("n8" + gs_192);
   ObjectDelete(gs_192 + "n8");
   ObjectDelete("txt" + gs_192 + "n8");
   ObjectDelete("n9" + gs_192);
   ObjectDelete(gs_192 + "n9");
   ObjectDelete("txt" + gs_192 + "n9");
   ObjectDelete("n10" + gs_192);
   ObjectDelete(gs_192 + "n10");
   ObjectDelete("txt" + gs_192 + "n10");
   ObjectDelete("n11" + gs_192);
   ObjectDelete(gs_192 + "n11");
   ObjectDelete("txt" + gs_192 + "n11");
   ObjectDelete("n12" + gs_192);
   ObjectDelete(gs_192 + "n12");
   ObjectDelete("txt" + gs_192 + "n12");
   ObjectDelete("n13" + gs_192);
   ObjectDelete(gs_192 + "n13");
   ObjectDelete("txt" + gs_192 + "n13");
   ObjectDelete("n14" + gs_192);
   ObjectDelete(gs_192 + "n14");
   ObjectDelete("txt" + gs_192 + "n14");
   ObjectDelete("n15" + gs_192);
   ObjectDelete(gs_192 + "n15");
   ObjectDelete("txt" + gs_192 + "n15");
   ObjectDelete("n16" + gs_192);
   ObjectDelete(gs_192 + "n16");
   ObjectDelete("txt" + gs_192 + "n16");
   ObjectDelete("p1" + gs_192);
   ObjectDelete(gs_192 + "p1");
   ObjectDelete("txt" + gs_192 + "p1");
   ObjectDelete("p2" + gs_192);
   ObjectDelete(gs_192 + "p2");
   ObjectDelete("txt" + gs_192 + "p2");
   ObjectDelete("p3" + gs_192);
   ObjectDelete(gs_192 + "p3");
   ObjectDelete("txt" + gs_192 + "p3");
   ObjectDelete("p4" + gs_192);
   ObjectDelete(gs_192 + "p4");
   ObjectDelete("txt" + gs_192 + "p4");
   ObjectDelete("p5" + gs_192);
   ObjectDelete(gs_192 + "p5");
   ObjectDelete("txt" + gs_192 + "p5");
   ObjectDelete("p6" + gs_192);
   ObjectDelete(gs_192 + "p6");
   ObjectDelete("txt" + gs_192 + "p6");
   ObjectDelete("p7" + gs_192);
   ObjectDelete(gs_192 + "p7");
   ObjectDelete("txt" + gs_192 + "p7");
   ObjectDelete("p8" + gs_192);
   ObjectDelete(gs_192 + "p8");
   ObjectDelete("txt" + gs_192 + "p8");
   ObjectDelete("p9" + gs_192);
   ObjectDelete(gs_192 + "p9");
   ObjectDelete("txt" + gs_192 + "p9");
   ObjectDelete("p10" + gs_192);
   ObjectDelete(gs_192 + "p10");
   ObjectDelete("txt" + gs_192 + "p10");
   ObjectDelete("p11" + gs_192);
   ObjectDelete(gs_192 + "p11");
   ObjectDelete("txt" + gs_192 + "p11");
   ObjectDelete("p12" + gs_192);
   ObjectDelete(gs_192 + "p12");
   ObjectDelete("txt" + gs_192 + "p12");
   ObjectDelete(gs_192 + "Percent");
}

void SetPrice(string a_name_0, int a_datetime_8, double a_price_12, color a_color_20) {
   if (ObjectFind(a_name_0) == -1) {
      ObjectCreate(a_name_0, OBJ_ARROW, 0, a_datetime_8, a_price_12);
      ObjectSet(a_name_0, OBJPROP_COLOR, a_color_20);
      ObjectSet(a_name_0, OBJPROP_WIDTH, 1);
      ObjectSet(a_name_0, OBJPROP_ARROWCODE, SYMBOL_RIGHTPRICE);
      return;
   }
   ObjectSet(a_name_0, OBJPROP_TIME1, a_datetime_8);
   ObjectSet(a_name_0, OBJPROP_PRICE1, a_price_12);
   ObjectSet(a_name_0, OBJPROP_COLOR, a_color_20);
   ObjectSet(a_name_0, OBJPROP_WIDTH, 1);
   ObjectSet(a_name_0, OBJPROP_ARROWCODE, SYMBOL_RIGHTPRICE);
}

void SetText(string a_name_0, string a_text_8, int a_datetime_16, double a_price_20, color a_color_28) {
   if (ObjectFind(a_name_0) == -1) {
      ObjectCreate(a_name_0, OBJ_TEXT, 0, a_datetime_16, a_price_20);
      ObjectSetText(a_name_0, a_text_8, 10, "Times New Roman", a_color_28);
      ObjectSet(a_name_0, OBJPROP_CORNER, 2);
      return;
   }
   ObjectSet(a_name_0, OBJPROP_TIME1, a_datetime_16);
   ObjectSet(a_name_0, OBJPROP_PRICE1, a_price_20);
   ObjectSetText(a_name_0, a_text_8, 10, "Times New Roman", a_color_28);
   ObjectSet(a_name_0, OBJPROP_CORNER, 2);
}

void SetLabel(string a_name_0, string a_text_8, int a_x_16, int a_y_20, string a_fontname_24, int a_fontsize_32, int a_angle_36, color a_color_40) {
   int l_window_44 = 0;
   if (ObjectFind(a_name_0) == -1) {
      ObjectCreate(a_name_0, OBJ_LABEL, l_window_44, 0, 0);
      ObjectSetText(a_name_0, a_text_8, a_fontsize_32, a_fontname_24, a_color_40);
      ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_16);
      ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_20);
      ObjectSet(a_name_0, OBJPROP_CORNER, 2);
      ObjectSet(a_name_0, OBJPROP_ANGLE, a_angle_36);
      return;
   }
   ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_16);
   ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_20);
   ObjectSetText(a_name_0, a_text_8, a_fontsize_32, a_fontname_24, a_color_40);
   ObjectSet(a_name_0, OBJPROP_CORNER, 2);
   ObjectSet(a_name_0, OBJPROP_ANGLE, a_angle_36);
}

void line(string a_name_0, double a_price_8, int a_datetime_16, int a_datetime_20, color a_color_24, int a_width_28) {
   if (ObjectFind(a_name_0) != 0) {
      ObjectCreate(a_name_0, OBJ_TREND, 0, a_datetime_16, a_price_8, a_datetime_20, a_price_8);
      ObjectSet(a_name_0, OBJPROP_COLOR, a_color_24);
      ObjectSet(a_name_0, OBJPROP_WIDTH, a_width_28);
      ObjectSet(a_name_0, OBJPROP_RAY, FALSE);
      return;
   }
   if (ObjectGet(a_name_0, OBJPROP_PRICE1) != a_price_8 || ObjectGet(a_name_0, OBJPROP_TIME1) != a_datetime_20) ObjectDelete(a_name_0);
}

string name2() {
   if (MyPeriod == PERIOD_M1) return ("M1");
   if (MyPeriod == PERIOD_M5) return ("M5");
   if (MyPeriod == PERIOD_M15) return ("M15");
   if (MyPeriod == PERIOD_M30) return ("M30");
   if (MyPeriod == PERIOD_H1) return ("H1");
   if (MyPeriod == PERIOD_H4) return ("H4");
   if (MyPeriod == PERIOD_D1) return ("D1");
   if (MyPeriod == PERIOD_W1) return ("W1");
   if (MyPeriod == PERIOD_MN1) return ("MNF=                               ");
   return ("");
}