Navigation:Home > Content >

Forex_goiler.mq4

Time: 2011-07-10 | Download file:Forex_goiler.mq4

#property copyright "Copyright © 2010, Mr. Hamada Salam, By YAM"
#property link      "         "

#property indicator_chart_window

extern string ___________________________ = "Font Size & Corner & Calculation";
extern int Font_Size = 10;
extern int Corner = 3;
extern bool Show_Calc = TRUE;
int g_color_96 = Yellow;

int init() {
   IndicatorShortName("HAMADASALAM_v1.5");
   ObjectsDeleteAll(0, OBJ_LABEL);
   return (0);
}

int deinit() {
   ObjectDelete("time");
   ObjectDelete("En1");
   ObjectDelete("En2");
   ObjectDelete("TP1");
   ObjectDelete("TP2");
   ObjectDelete("SL");
   ObjectDelete("Calculation1");
   ObjectDelete("Calculation2");
   ObjectDelete("дЮШЙ ЗбПОжб");
   ObjectDelete("ЗбКИСнП");
   ObjectDelete("еПЭ Гжб");
   ObjectDelete("еПЭ ЛЗдн");
   ObjectDelete("жЮЭ ЗбОУЗСЙ");
   return (0);
}

int start() {
   double ld_0;
   double ld_8;
   double ld_16;
   double ld_24;
   double ld_32;
   string text_40;
   string text_48;
   string text_56;
   string text_64;
   string text_72;
   string text_80;
   string text_88;
   int ind_counted_96 = IndicatorCounted();
   double ld_100 = 0;
   double ld_108 = 0;
   double ld_116 = 0;
   double ld_124 = 0;
   double ld_132 = 0;
   double ld_140 = 0;
   double ld_148 = 0;
   double ld_156 = 0;
   double ld_164 = 0;
   double ld_172 = 0;
   double ld_180 = 0;
   int li_188 = 100;
   int li_192 = 3;
   if (StringFind(Symbol(), "JPY", 0) == -1) li_188 = 10000;
   if (StringFind(Symbol(), "JPY", 0) == -1) li_192 = 5;
   ld_100 = iOpen(Symbol(), PERIOD_D1, 0) * li_188;
   ld_108 = MathMod(180.0 * MathSqrt(ld_100) - 225.0, 360);
   if (ld_108 >= 90.0) {
      ld_124 = NormalizeDouble(ld_108 / 90.0, 0);
      ld_148 = ld_108 / ld_124;
      ld_172 = ld_148 / 180.0;
      ld_116 = ld_124;
      ld_140 = ld_148;
      ld_164 = ld_172;
   } else {
      ld_132 = NormalizeDouble(90 / ld_108, 0);
      ld_156 = ld_108 * ld_132;
      ld_180 = ld_156 / 180.0;
      ld_116 = ld_132;
      ld_140 = ld_156;
      ld_164 = ld_180;
   }
   double ld_196 = MathSqrt(ld_100);
   if (ld_108 >= 0.0 && ld_108 <= 90.0) {
      ld_0 = ld_100 / li_188;
      ld_8 = (ld_196 - ld_164 / 2.0) * (ld_196 - ld_164 / 2.0) / li_188;
      ld_16 = (ld_196 + ld_164 / 2.0) * (ld_196 + ld_164 / 2.0) / li_188;
      ld_24 = (ld_196 + ld_164) * (ld_196 + ld_164) / li_188;
      ld_32 = (ld_196 - ld_164) * (ld_196 - ld_164) / li_188;
      Level("дЮШЙ ЗбПОжб", ld_0, White, 2);
      Level("ЗбКИСнП", ld_8, Orange, 2);
      Level("еПЭ Гжб", ld_16, Lime, 2);
      Level("еПЭ ЛЗдн", ld_24, Green, 2);
      Level("жЮЭ ЗбОУЗСЙ", ld_32, Red, 2);
   }
   if (ld_108 >= 180.0 && ld_108 <= 270.0) {
      ld_0 = ld_100 / li_188;
      ld_8 = (ld_196 - ld_164 / 2.0) * (ld_196 - ld_164 / 2.0) / li_188;
      ld_16 = (ld_196 + ld_164 / 2.0) * (ld_196 + ld_164 / 2.0) / li_188;
      ld_24 = (ld_196 + ld_164) * (ld_196 + ld_164) / li_188;
      ld_32 = (ld_196 - ld_164) * (ld_196 - ld_164) / li_188;
      Level("дЮШЙ ЗбПОжб", ld_0, White, 2);
      Level("ЗбКИСнП", ld_8, Orange, 2);
      Level("еПЭ Гжб", ld_16, Lime, 2);
      Level("еПЭ ЛЗдн", ld_24, Green, 2);
      Level("жЮЭ ЗбОУЗСЙ", ld_32, Red, 2);
   }
   if (ld_108 >= 91.0 && ld_108 < 180.0) {
      ld_0 = ld_100 / li_188;
      ld_8 = (ld_196 + ld_164 / 2.0) * (ld_196 + ld_164 / 2.0) / li_188;
      ld_16 = (ld_196 - ld_164 / 2.0) * (ld_196 - ld_164 / 2.0) / li_188;
      ld_24 = (ld_196 - ld_164) * (ld_196 - ld_164) / li_188;
      ld_32 = (ld_196 + ld_164) * (ld_196 + ld_164) / li_188;
      Level("дЮШЙ ЗбПОжб", ld_0, White, 2);
      Level("ЗбКИСнП", ld_8, Orange, 2);
      Level("еПЭ Гжб", ld_16, Lime, 2);
      Level("еПЭ ЛЗдн", ld_24, Green, 2);
      Level("жЮЭ ЗбОУЗСЙ", ld_32, Red, 2);
   }
   if (ld_108 >= 271.0 && ld_108 <= 360.0) {
      ld_0 = ld_100 / li_188;
      ld_8 = (ld_196 + ld_164 / 2.0) * (ld_196 + ld_164 / 2.0) / li_188;
      ld_16 = (ld_196 - ld_164 / 2.0) * (ld_196 - ld_164 / 2.0) / li_188;
      ld_24 = (ld_196 - ld_164) * (ld_196 - ld_164) / li_188;
      ld_32 = (ld_196 + ld_164) * (ld_196 + ld_164) / li_188;
      Level("дЮШЙ ЗбПОжб", ld_0, White, 2);
      Level("ЗбКИСнП", ld_8, Orange, 2);
      Level("еПЭ Гжб", ld_16, Lime, 2);
      Level("еПЭ ЛЗдн", ld_24, Green, 2);
      Level("жЮЭ ЗбОУЗСЙ", ld_32, Red, 2);
   }
   string dbl2str_204 = DoubleToStr(ld_0, li_192);
   string dbl2str_212 = DoubleToStr(ld_8, li_192);
   string dbl2str_220 = DoubleToStr(ld_16, li_192);
   string dbl2str_228 = DoubleToStr(ld_24, li_192);
   string dbl2str_236 = DoubleToStr(ld_32, li_192);
   string name_244 = "En1";
   string name_252 = "En2";
   string name_260 = "TP1";
   string name_268 = "TP2";
   string name_276 = "SL";
   string name_284 = "Calculation1";
   string name_292 = "Calculation2";
   if (Show_Calc == TRUE) {
      text_40 = text_40 + "   " + "Entry_1 : " + dbl2str_204;
      ObjectCreate(name_244, OBJ_LABEL, 0, 0, 0);
      ObjectSetText(name_244, text_40, Font_Size, "Arial Bold", White);
      ObjectSet(name_244, OBJPROP_CORNER, Corner);
      ObjectSet(name_244, OBJPROP_XDISTANCE, 20);
      ObjectSet(name_244, OBJPROP_YDISTANCE, 120);
      text_48 = text_48 + "   " + "Entry_2 : " + dbl2str_212;
      ObjectCreate(name_252, OBJ_LABEL, 0, 0, 0);
      ObjectSetText(name_252, text_48, Font_Size, "Arial Bold", Orange);
      ObjectSet(name_252, OBJPROP_CORNER, Corner);
      ObjectSet(name_252, OBJPROP_XDISTANCE, 20);
      ObjectSet(name_252, OBJPROP_YDISTANCE, 100);
      text_56 = text_56 + "   " + "TP1 : " + dbl2str_220;
      ObjectCreate(name_260, OBJ_LABEL, 0, 0, 0);
      ObjectSetText(name_260, text_56, Font_Size, "Arial Bold", Lime);
      ObjectSet(name_260, OBJPROP_CORNER, Corner);
      ObjectSet(name_260, OBJPROP_XDISTANCE, 20);
      ObjectSet(name_260, OBJPROP_YDISTANCE, 80);
      text_64 = text_64 + "   " + "TP2 : " + dbl2str_228;
      ObjectCreate(name_268, OBJ_LABEL, 0, 0, 0);
      ObjectSetText(name_268, text_64, Font_Size, "Arial Bold", Green);
      ObjectSet(name_268, OBJPROP_CORNER, Corner);
      ObjectSet(name_268, OBJPROP_XDISTANCE, 20);
      ObjectSet(name_268, OBJPROP_YDISTANCE, 60);
      text_72 = text_72 + "   " + "SL : " + dbl2str_236;
      ObjectCreate(name_276, OBJ_LABEL, 0, 0, 0);
      ObjectSetText(name_276, text_72, Font_Size, "Arial Bold", Red);
      ObjectSet(name_276, OBJPROP_CORNER, Corner);
      ObjectSet(name_276, OBJPROP_XDISTANCE, 20);
      ObjectSet(name_276, OBJPROP_YDISTANCE, 40);
      text_80 = text_80 + "   " + "OP : " + dbl2str_204 + "   " + "P.Angle : " + DoubleToStr(ld_108, 0) + "   " + "Adjustment: " + DoubleToStr(ld_116, 0);
      ObjectCreate(name_284, OBJ_LABEL, 0, 0, 0);
      ObjectSetText(name_284, text_80, 8, "Arial Bold", White);
      ObjectSet(name_284, OBJPROP_CORNER, Corner);
      ObjectSet(name_284, OBJPROP_XDISTANCE, 20);
      ObjectSet(name_284, OBJPROP_YDISTANCE, 20);
      text_88 = text_88 + "   " + "Corrected P.Angle : " + DoubleToStr(ld_140, 0) + "   " + "Factor : " + DoubleToStr(ld_164, 5);
      ObjectCreate(name_292, OBJ_LABEL, 0, 0, 0);
      ObjectSetText(name_292, text_88, 8, "Arial Bold", White);
      ObjectSet(name_292, OBJPROP_CORNER, Corner);
      ObjectSet(name_292, OBJPROP_XDISTANCE, 20);
      ObjectSet(name_292, OBJPROP_YDISTANCE, 10);
   } else {
      text_40 = text_40 + "   " + "Entry_1 : " + dbl2str_204;
      ObjectCreate(name_244, OBJ_LABEL, 0, 0, 0);
      ObjectSetText(name_244, text_40, Font_Size, "Arial Bold", White);
      ObjectSet(name_244, OBJPROP_CORNER, Corner);
      ObjectSet(name_244, OBJPROP_XDISTANCE, 20);
      ObjectSet(name_244, OBJPROP_YDISTANCE, 120);
      text_48 = text_48 + "   " + "Entry_2 : " + dbl2str_212;
      ObjectCreate(name_252, OBJ_LABEL, 0, 0, 0);
      ObjectSetText(name_252, text_48, Font_Size, "Arial Bold", Orange);
      ObjectSet(name_252, OBJPROP_CORNER, Corner);
      ObjectSet(name_252, OBJPROP_XDISTANCE, 20);
      ObjectSet(name_252, OBJPROP_YDISTANCE, 100);
      text_56 = text_56 + "   " + "TP1 : " + dbl2str_220;
      ObjectCreate(name_260, OBJ_LABEL, 0, 0, 0);
      ObjectSetText(name_260, text_56, Font_Size, "Arial Bold", Lime);
      ObjectSet(name_260, OBJPROP_CORNER, Corner);
      ObjectSet(name_260, OBJPROP_XDISTANCE, 20);
      ObjectSet(name_260, OBJPROP_YDISTANCE, 80);
      text_64 = text_64 + "   " + "TP2 : " + dbl2str_228;
      ObjectCreate(name_268, OBJ_LABEL, 0, 0, 0);
      ObjectSetText(name_268, text_64, Font_Size, "Arial Bold", Green);
      ObjectSet(name_268, OBJPROP_CORNER, Corner);
      ObjectSet(name_268, OBJPROP_XDISTANCE, 20);
      ObjectSet(name_268, OBJPROP_YDISTANCE, 60);
      text_72 = text_72 + "   " + "SL : " + dbl2str_236;
      ObjectCreate(name_276, OBJ_LABEL, 0, 0, 0);
      ObjectSetText(name_276, text_72, Font_Size, "Arial Bold", Red);
      ObjectSet(name_276, OBJPROP_CORNER, Corner);
      ObjectSet(name_276, OBJPROP_XDISTANCE, 20);
      ObjectSet(name_276, OBJPROP_YDISTANCE, 40);
   }
   int li_300 = Time[0] + 60 * Period() - TimeCurrent();
   double ld_304 = li_300 / 60.0;
   int li_312 = li_300 % 60;
   li_300 = (li_300 - li_300 % 60) / 60;
   Comment(li_300 + " minutes " + li_312 + " seconds left to bar end");
   ObjectDelete("time");
   if (ObjectFind("time") != 0) {
      ObjectCreate("time", OBJ_TEXT, 0, Time[0], Close[0] + 0.0005);
      ObjectSetText("time", "                  <" + li_300 + ":" + li_312, 8, "Arial", g_color_96);
   } else ObjectMove("time", 0, Time[0], Close[0] + 0.0005);
   return (0);
}

int Level(string a_name_0, double a_price_8, color a_color_16, int a_width_20) {
   if (ObjectFind(a_name_0) != 0) {
      ObjectCreate(a_name_0, OBJ_HLINE, 0, Time[0], a_price_8);
      ObjectSet(a_name_0, OBJPROP_STYLE, STYLE_SOLID);
      ObjectSet(a_name_0, OBJPROP_COLOR, a_color_16);
      ObjectSet(a_name_0, OBJPROP_WIDTH, a_width_20);
      ObjectCreate(a_name_0, OBJ_TEXT, 0, Time[0], a_price_8);
      ObjectSetText(a_name_0, "", 8, "Arial", a_color_16);
   } else ObjectMove(a_name_0, 0, Time[0], a_price_8);
   return (0);
}

Recommend