Navigation´╝ÜHome > Content >

supermathprofit.mq4

Time: 2016-03-14 | Download file:supermathprofit.mq4

#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 DodgerBlue
#property indicator_color2 Red
#property indicator_color3 DodgerBlue
#property indicator_color4 Red
#property indicator_color5 DodgerBlue
#property indicator_color6 Red

extern int Gl_period_76 = 6;
extern int Gli_80 = 2;
extern int MM = 1;
extern int Gli_88 = 1;
extern int Gli_92 = 1;
extern int Gl_shift_96 = 1000;
extern int SL_pips = 20;
double Gl_ibuf_104[];
double Gl_ibuf_108[];
double Gl_ibuf_112[];
double Gl_ibuf_116[];
double Gl_ibuf_120[];
double Gl_ibuf_124[];
extern bool AlertON = TRUE;
extern bool Email = TRUE;
bool Gli_136 = FALSE;
bool Gli_140 = FALSE;
datetime Gl_time_144;

// AA82CF3A41CEBBF1D981F099A58AD043
void f0_0(string Ars_0, double Ard_8, double Ard_16, double Ard_24) {
   string Lcs_32;
   string Lcs_40;
   string Lcs_48;
   string Lcs_56;
   string Lcs_64;
   if (Time[0] != Gl_time_144) {
      Gl_time_144 = Time[0];
      if (Ard_24 != 0.0) Lcs_48 = " at price " + DoubleToStr(Ard_24, 4);
      else Lcs_48 = "";
      if (Ard_8 != 0.0) Lcs_40 = ", TakeProfit on " + DoubleToStr(Ard_8, 4);
      else Lcs_40 = "";
      if (Ard_16 != 0.0) Lcs_32 = ", StopLoss on " + DoubleToStr(Ard_16, 4);
      else Lcs_32 = "";
      Alert("math " + Ars_0 + Lcs_48 + Lcs_40 + Lcs_32 + " ", Symbol(), ", ", Period(), " minutes chart");
      Lcs_56 = "math " + Ars_0 + Lcs_48;
      Lcs_64 = "math " + Ars_0 + Lcs_48 + Lcs_40 + Lcs_32 + " " + Symbol() + ", " + Period() + " minutes chart";
      if (Email) SendMail(Lcs_56, Lcs_64);
   }
}

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   SetIndexBuffer(0, Gl_ibuf_104);
   SetIndexBuffer(1, Gl_ibuf_108);
   SetIndexBuffer(2, Gl_ibuf_112);
   SetIndexBuffer(3, Gl_ibuf_116);
   SetIndexBuffer(4, Gl_ibuf_120);
   SetIndexBuffer(5, Gl_ibuf_124);
   SetIndexStyle(0, DRAW_NONE, STYLE_DASH, 2);
   SetIndexStyle(1, DRAW_NONE, STYLE_DASH, 2);
   SetIndexStyle(2, DRAW_ARROW, STYLE_DASH, 4);
   SetIndexStyle(3, DRAW_ARROW, STYLE_DASH, 4);
   SetIndexStyle(4, DRAW_NONE, STYLE_DASH, 2);
   SetIndexStyle(5, DRAW_NONE, STYLE_DASH, 2);
   SetIndexArrow(0, 159);
   SetIndexArrow(1, 159);
   SetIndexArrow(2, SYMBOL_ARROWUP);
   SetIndexArrow(3, SYMBOL_ARROWDOWN);
   IndicatorDigits(MarketInfo(Symbol(), MODE_DIGITS));
   string Lcs_0 = "math(" + AlertON + "," + Gli_80 + ")";
   IndicatorShortName(Lcs_0);
   SetIndexLabel(0, "");
   SetIndexLabel(1, "");
   SetIndexLabel(2, "");
   SetIndexLabel(3, "");
   SetIndexLabel(4, "");
   SetIndexLabel(5, "");
   SetIndexDrawBegin(0, Gl_period_76);
   SetIndexDrawBegin(1, Gl_period_76);
   SetIndexDrawBegin(2, Gl_period_76);
   SetIndexDrawBegin(3, Gl_period_76);
   SetIndexDrawBegin(4, Gl_period_76);
   SetIndexDrawBegin(5, Gl_period_76);
   return (0);
}

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   int Lci_8;
   double Lcda_12[25000];
   double Lcda_16[25000];
   double Lcda_20[25000];
   double Lcda_24[25000];
   double Lcd_28;
   double close_36;
   for (int shift_4 = Gl_shift_96; shift_4 > 0; shift_4--) {
      Gl_ibuf_104[shift_4] = 0;
      Gl_ibuf_108[shift_4] = 0;
      Gl_ibuf_112[shift_4] = 0;
      Gl_ibuf_116[shift_4] = 0;
      Gl_ibuf_120[shift_4] = EMPTY_VALUE;
      Gl_ibuf_124[shift_4] = EMPTY_VALUE;
   }
   for (shift_4 = Gl_shift_96 - Gl_period_76 - 1; shift_4 > 0; shift_4--) {
      Lcda_12[shift_4] = iBands(NULL, 0, Gl_period_76, Gli_80, 0, PRICE_CLOSE, MODE_UPPER, shift_4);
      Lcda_16[shift_4] = iBands(NULL, 0, Gl_period_76, Gli_80, 0, PRICE_CLOSE, MODE_LOWER, shift_4);
      if (Close[shift_4] > Lcda_12[shift_4 + 1]) Lci_8 = 1;
      if (Close[shift_4] < Lcda_16[shift_4 + 1]) Lci_8 = -1;
      if (Lci_8 > 0 && Lcda_16[shift_4] < Lcda_16[shift_4 + 1]) Lcda_16[shift_4] = Lcda_16[shift_4 + 1];
      if (Lci_8 < 0 && Lcda_12[shift_4] > Lcda_12[shift_4 + 1]) Lcda_12[shift_4] = Lcda_12[shift_4 + 1];
      Lcda_20[shift_4] = Lcda_12[shift_4] + (MM - 1) / 2.0 * (Lcda_12[shift_4] - Lcda_16[shift_4]);
      Lcda_24[shift_4] = Lcda_16[shift_4] - (MM - 1) / 2.0 * (Lcda_12[shift_4] - Lcda_16[shift_4]);
      if (Lci_8 > 0 && Lcda_24[shift_4] < Lcda_24[shift_4 + 1]) Lcda_24[shift_4] = Lcda_24[shift_4 + 1];
      if (Lci_8 < 0 && Lcda_20[shift_4] > Lcda_20[shift_4 + 1]) Lcda_20[shift_4] = Lcda_20[shift_4 + 1];
      if (Lci_8 > 0) {
         if (Gli_88 > 0 && Gl_ibuf_104[shift_4 + 1] == -1.0) {
            Gl_ibuf_112[shift_4] = Lcda_24[shift_4];
            Gl_ibuf_104[shift_4] = Lcda_24[shift_4];
            if (Gli_92 > 0) Gl_ibuf_120[shift_4] = Lcda_24[shift_4];
            if (AlertON == TRUE && shift_4 == 1 && (!Gli_136)) {
               Lcd_28 = Low[1];
               if (Low[2] < Lcd_28) Lcd_28 = Low[2];
               if (Low[3] < Lcd_28) Lcd_28 = Low[3];
               if (Low[4] < Lcd_28) Lcd_28 = Low[4];
               Lcd_28 -= SL_pips * Point;
               close_36 = Close[1];
               f0_0("Buy SUPERMATHPROFIT", 0, Lcd_28, close_36);
               Gli_136 = TRUE;
               Gli_140 = FALSE;
            }
         } else {
            Gl_ibuf_104[shift_4] = Lcda_24[shift_4];
            if (Gli_92 > 0) Gl_ibuf_120[shift_4] = Lcda_24[shift_4];
            Gl_ibuf_112[shift_4] = -1;
         }
         if (Gli_88 == 2) Gl_ibuf_104[shift_4] = 0;
         Gl_ibuf_116[shift_4] = -1;
         Gl_ibuf_108[shift_4] = -1.0;
         Gl_ibuf_124[shift_4] = EMPTY_VALUE;
      }
      if (Lci_8 < 0) {
         if (Gli_88 > 0 && Gl_ibuf_108[shift_4 + 1] == -1.0) {
            Gl_ibuf_116[shift_4] = Lcda_20[shift_4];
            Gl_ibuf_108[shift_4] = Lcda_20[shift_4];
            if (Gli_92 > 0) Gl_ibuf_124[shift_4] = Lcda_20[shift_4];
            if (AlertON == TRUE && shift_4 == 1 && (!Gli_140)) {
               Lcd_28 = High[1];
               if (High[2] > Lcd_28) Lcd_28 = High[2];
               if (High[3] > Lcd_28) Lcd_28 = High[3];
               if (High[4] > Lcd_28) Lcd_28 = High[4];
               Lcd_28 += SL_pips * Point;
               close_36 = Close[1];
               f0_0("Sell SUPERMATHPROFIT", 0, Lcd_28, close_36);
               Gli_140 = TRUE;
               Gli_136 = FALSE;
            }
         } else {
            Gl_ibuf_108[shift_4] = Lcda_20[shift_4];
            if (Gli_92 > 0) Gl_ibuf_124[shift_4] = Lcda_20[shift_4];
            Gl_ibuf_116[shift_4] = -1;
         }
         if (Gli_88 == 2) Gl_ibuf_108[shift_4] = 0;
         Gl_ibuf_112[shift_4] = -1;
         Gl_ibuf_104[shift_4] = -1.0;
         Gl_ibuf_120[shift_4] = EMPTY_VALUE;
      }
   }
   return (0);
}

Recommend