Navigation´╝ÜHome > Content >

100pipsfxgainer5.mq4

Time: 2016-01-24 | Download file:100pipsfxgainer5.mq4

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Blue
#property indicator_color2 Yellow
#property indicator_color3 White

extern int PIPSFXGAINER = 21;
int gi_80 = 0;
extern int Mode = 3;
int g_applied_price_88 = PRICE_CLOSE;
extern double FxVolume = 2.0;
bool gi_100 = FALSE;
extern int aTake_Profit = 150;
extern int aStop_Loss = 150;
extern bool aAlerts = TRUE;
extern bool EmailOn = TRUE;
bool gi_120 = FALSE;
bool gi_124 = FALSE;
datetime g_time_128;
string gs_144;
double g_ibuf_152[];
double g_ibuf_156[];
double g_ibuf_160[];
double g_ibuf_164[];
int gi_168;
string gs_172;
int gi_unused_180 = 0;

// 4A3943D5FBF2CBD3EF4A02E976FC1018
string f0_2() {
   string timeframe_4;
   switch (Period()) {
   case PERIOD_M1:
      timeframe_4 = "M1";
      break;
   case PERIOD_M5:
      timeframe_4 = "";
      break;
   case PERIOD_M15:
      timeframe_4 = "";
      break;
   case PERIOD_M30:
      timeframe_4 = "";
      break;
   case PERIOD_H1:
      timeframe_4 = "";
      break;
   case PERIOD_H4:
      timeframe_4 = "";
      break;
   case PERIOD_D1:
      timeframe_4 = "";
      break;
   case PERIOD_W1:
      timeframe_4 = "";
      break;
   case PERIOD_MN1:
      timeframe_4 = "";
      break;
   default:
      timeframe_4 = Period();
   }
   return (timeframe_4);
}

// EAC4E9E33F3538045A48AFD1169EE124
void f0_6(string as_0, double ad_8, double ad_16, double ad_24) {
   string ls_32;
   string ls_40;
   string ls_48;
   string ls_56;
   if (Time[0] != g_time_128) {
      g_time_128 = Time[0];
      if (gs_144 != as_0) {
         if (gs_144 == "") gs_144 = as_0;
         else {
            gs_144 = as_0;
            if (ad_8 != 0.0) ls_48 = " - Price " + DoubleToStr(ad_8, 4);
            else ls_48 = "";
            if (ad_16 != 0.0) ls_40 = ", StopLoss  " + DoubleToStr(ad_16, 4);
            else ls_40 = "";
            if (ad_24 != 0.0) ls_32 = ", TakeProfit   " + DoubleToStr(ad_24, 4);
            else ls_32 = "";
            ls_56 = gs_172 + "PIPSFXGAINER " + f0_1() + as_0 + ls_48 + ls_40 + ls_32 + "Date & Time = " + TimeToStr(TimeCurrent(), TIME_DATE) + " " + TimeHour(TimeCurrent()) + ":" + TimeMinute(TimeCurrent()) + " ";
            Alert(ls_56, Symbol(), ", ", Period(), " minutes chart");
            if (EmailOn) SendMail(gs_172, ls_56);
         }
      }
   }
}

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   IndicatorBuffers(4);
   if ((!SetIndexBuffer(0, g_ibuf_152)) && !SetIndexBuffer(1, g_ibuf_156) && (!SetIndexBuffer(2, g_ibuf_160)) && (!SetIndexBuffer(3, g_ibuf_164))) Print("Buffers Up");
   if (gi_100) {
      SetIndexStyle(0, DRAW_ARROW);
      SetIndexStyle(1, DRAW_ARROW);
      SetIndexStyle(2, DRAW_ARROW);
      SetIndexArrow(0, 159);
      SetIndexArrow(1, 159);
      SetIndexArrow(2, 159);
   } else {
      SetIndexStyle(0, DRAW_HISTOGRAM);
      SetIndexStyle(1, DRAW_HISTOGRAM);
      SetIndexStyle(2, DRAW_HISTOGRAM);
   }
   gi_168 = PIPSFXGAINER + MathFloor(MathSqrt(PIPSFXGAINER));
   SetIndexDrawBegin(0, gi_168);
   SetIndexDrawBegin(1, gi_168);
   SetIndexDrawBegin(2, gi_168);
   IndicatorDigits(MarketInfo(Symbol(), MODE_DIGITS) + 1.0);
   IndicatorShortName("PIPSFXGAINER(" + PIPSFXGAINER + ")");
   SetIndexLabel(0, "PIPSFXGAINER");
   gs_172 = Symbol() + " (" + f0_2() + "):  ";
   gi_120 = TRUE;
   gi_124 = TRUE;
   gs_144 = "";
   return (0);
}

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   double ima_on_arr_12;
   double ima_on_arr_20;
   int li_8 = IndicatorCounted();
   if (li_8 > 0) li_8--;
   int li_0 = Bars - li_8;
   int li_unused_28 = MathFloor(MathSqrt(PIPSFXGAINER));
   for (int li_32 = 0; li_32 <= li_0; li_32++) {
      g_ibuf_164[li_32] = 2.0 * iMA(NULL, 0, MathFloor(PIPSFXGAINER / FxVolume), gi_80, Mode, g_applied_price_88, li_32) - iMA(NULL, 0, PIPSFXGAINER, gi_80, Mode, g_applied_price_88,
         li_32);
   }
   for (int li_4 = 1; li_4 <= li_0 + 1; li_4++) {
      ima_on_arr_12 = iMAOnArray(g_ibuf_164, 0, MathFloor(MathSqrt(PIPSFXGAINER)), 0, Mode, li_4);
      ima_on_arr_20 = iMAOnArray(g_ibuf_164, 0, MathFloor(MathSqrt(PIPSFXGAINER)), 0, Mode, li_4 + 1);
      if (ima_on_arr_20 > ima_on_arr_12) {
         g_ibuf_152[li_4] = EMPTY_VALUE;
         g_ibuf_156[li_4] = EMPTY_VALUE;
         g_ibuf_160[li_4] = ima_on_arr_12;
      } else {
         if (ima_on_arr_20 < ima_on_arr_12) {
            g_ibuf_152[li_4] = ima_on_arr_12;
            g_ibuf_156[li_4] = EMPTY_VALUE;
            g_ibuf_160[li_4] = EMPTY_VALUE;
         } else {
            g_ibuf_152[li_4] = -1;
            g_ibuf_156[li_4] = ima_on_arr_12;
            g_ibuf_160[li_4] = -1;
         }
      }
      if (aAlerts) {
         if (ima_on_arr_20 < ima_on_arr_12) {
            if (!gi_120)
               if (li_4 == 2 && li_8 > 0) f0_6("sell signal", Close[0], f0_4(), f0_3());
            gi_120 = TRUE;
            gi_124 = FALSE;
         }
         if (ima_on_arr_20 > ima_on_arr_12) {
            if (!gi_124)
               if (li_4 == 2 && li_8 > 0) f0_6("buy signal", Open[0], f0_5(), f0_0());
            gi_124 = TRUE;
            gi_120 = FALSE;
         }
      }
   }
   return (0);
}

// A175ED0148C846DCBD15C5151A4F0BAF
double f0_5() {
   return (Bid - aTake_Profit * Point);
}

// 8208878A4EC7F97E49E54D58CA29C1B1
double f0_4() {
   return (Ask + aTake_Profit * Point);
}

// 09F6C199E63778DA51A1332C863719B5
double f0_0() {
   return (Bid + aStop_Loss * Point);
}

// 639A219768B3E002B71140739E24DF1C
double f0_3() {
   return (Ask - aStop_Loss * Point);
}

// 2D323144BD979BFEF42292739B4C879E
int f0_1() {
   return (10000.0 * (PIPSFXGAINER * Point));
}

Recommend