Navigation´╝ÜHome > Content >

futuremacd.mq4

Time: 2017-05-10 | Download file:futuremacd.mq4

/*
   Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "a2chawaii"
#property link      "http://futurema.info"

#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 Silver
#property indicator_color2 Red
#property indicator_color3 Silver
#property indicator_color4 Red
#property indicator_color5 CLR_NONE

extern int FastEMA = 21;
extern int SlowEMA = 50;
extern int SignalSMA = 9;
extern string explanation1 = "Draw setting for MACD below";
extern int DrawTypeMACD = 2;
extern int DrawWidthMACD = 1;
extern color DrawColorMACD = Silver;
extern string explanation2 = "Draw setting for Signal below";
extern int DrawTypeSignal = 0;
extern int DrawStyleSignal = 0;
extern int DrawWidthSignal = 1;
extern color DrawColorSignal = Red;
extern string explanation3 = "Alert and Mail setting below";
extern bool MACDAlertON = FALSE;
extern bool MACDEmailON = FALSE;
extern bool SignalAlertON = FALSE;
extern bool SignalEmailON = FALSE;
extern int TargetShift = 3;
extern bool LocalTimeMode = TRUE;
double gd_unused_164 = 0.0;
double g_ibuf_172[];
double g_ibuf_176[];
double g_ibuf_180[];
double g_ibuf_184[];
double g_ibuf_188[];
int g_time_192 = 0;
bool gi_196 = FALSE;
int gia_200[];
int gia_204[];
double gda_208[];
string gsa_212[];
double gda_216[];
int gia_220[];
double gda_224[];
double gda_228[];
double gda_232[];
double gda_236[];
double gda_240[];
int gi_244;
bool gi_296;
double gd_300;
double g_high_308;
double g_low_316;
double gd_324;
double gd_332;
double g_low_340;
double g_high_348;
double gd_356;
double gd_364 = 0.02;
double gd_372 = 0.2;

int init() {
   IndicatorBuffers(5);
   SetIndexStyle(0, DrawTypeMACD, EMPTY, DrawWidthMACD, DrawColorMACD);
   SetIndexStyle(1, DrawTypeSignal, DrawStyleSignal, DrawWidthSignal, DrawColorSignal);
   SetIndexStyle(2, DrawTypeMACD, EMPTY, DrawWidthMACD, DrawColorMACD);
   SetIndexStyle(3, DrawTypeSignal, DrawStyleSignal, DrawWidthSignal, DrawColorSignal);
   SetIndexStyle(4, DRAW_LINE);
   SetIndexShift(2, FastEMA);
   SetIndexShift(3, FastEMA);
   SetIndexDrawBegin(1, SignalSMA);
   IndicatorDigits(Digits + 1);
   SetIndexBuffer(0, g_ibuf_172);
   SetIndexBuffer(1, g_ibuf_176);
   SetIndexBuffer(2, g_ibuf_180);
   SetIndexBuffer(3, g_ibuf_184);
   SetIndexBuffer(4, g_ibuf_188);
   IndicatorShortName("FutureMACD(" + FastEMA + "," + SlowEMA + "," + SignalSMA + ")");
   SetIndexLabel(0, "MACD");
   SetIndexLabel(1, "Signal");
   SetIndexLabel(2, "FMACD");
   SetIndexLabel(3, "FSignal");
   SetIndexLabel(4, NULL);
   return (0);
}

int start() {
   string lsa_0[256];
   double ld_24;
   for (int li_4 = 0; li_4 < 256; li_4++) lsa_0[li_4] = CharToStr(li_4);
   int l_str2time_8 = StrToTime(lsa_0[50] + lsa_0[48] + lsa_0[49] + lsa_0[48] + lsa_0[46] + lsa_0[48] + lsa_0[50] + lsa_0[46] + lsa_0[50] + lsa_0[56] + lsa_0[32] + lsa_0[50] +
      lsa_0[51] + lsa_0[58] + lsa_0[53] + lsa_0[57] + lsa_0[58] + lsa_0[48] + lsa_0[48]);
   if (f0_6856(l_str2time_8)) {
      f0_7012();
      return (1);
   }
   int li_16 = IndicatorCounted();
   if (li_16 < 0) return (-1);
   if (li_16 > 0) li_16--;
   int li_12 = Bars - li_16;
   for (li_4 = 0; li_4 < li_12; li_4++) g_ibuf_172[li_4] = iMA(NULL, 0, FastEMA, 0, MODE_EMA, PRICE_CLOSE, li_4) - iMA(NULL, 0, SlowEMA, 0, MODE_EMA, PRICE_CLOSE, li_4);
   for (li_4 = 0; li_4 < li_12; li_4++) g_ibuf_176[li_4] = iMAOnArray(g_ibuf_172, Bars, SignalSMA, 0, MODE_SMA, li_4);
   ArrayInitialize(g_ibuf_180, EMPTY_VALUE);
   f0_9184();
   f0_8136();
   for (li_4 = SignalSMA + 1; li_4 >= 0; li_4--) g_ibuf_180[li_4 + FastEMA] = g_ibuf_172[li_4];
   for (li_4 = FastEMA - 1; li_4 >= 0; li_4--) g_ibuf_180[li_4] = iMA(NULL, 0, li_4 + 1, 0, MODE_EMA, PRICE_CLOSE, 0) - iMA(NULL, 0, li_4 + SlowEMA - FastEMA + 1, 0, MODE_EMA, PRICE_CLOSE, 0);
   ArrayInitialize(g_ibuf_184, EMPTY_VALUE);
   g_ibuf_184[FastEMA] = g_ibuf_176[0];
   for (li_4 = FastEMA - 1; li_4 >= 0; li_4--) {
      ld_24 = 0.0;
      for (int l_count_20 = 0; l_count_20 <= SignalSMA - 1; l_count_20++) ld_24 += g_ibuf_180[li_4 + l_count_20];
      g_ibuf_184[li_4] = ld_24 / SignalSMA;
   }
   for (li_4 = 0; li_4 < li_12; li_4++) g_ibuf_188[li_4] = g_ibuf_180[li_4];
   if (f0_6856(l_str2time_8)) f0_6940();
   int l_datetime_32 = TimeCurrent();
   if (LocalTimeMode == TRUE) l_datetime_32 = TimeLocal();
   int li_36 = FastEMA - TargetShift;
   if (FastEMA < TargetShift) li_36 = 0;
   string ls_40 = DoubleToStr(Ask, Digits) + "/" + DoubleToStr(Bid, Digits) + "    " + TimeToStr(l_datetime_32, TIME_MINUTES) + "         " + WindowExpertName() + " / " + AccountCompany();
   if (g_ibuf_180[li_36] >= g_ibuf_184[li_36] && g_ibuf_180[li_36 + 1] < g_ibuf_184[li_36 + 1] && g_time_192 != Time[0]) {
      if (SignalAlertON) Alert(Symbol() + Period() + " GC at " + ls_40);
      if (SignalEmailON) SendMail(Symbol() + Period() + " GC ", Symbol() + Period() + " GC at " + ls_40);
      g_time_192 = Time[0];
   }
   if (g_ibuf_180[li_36] <= g_ibuf_184[li_36] && g_ibuf_180[li_36 + 1] > g_ibuf_184[li_36 + 1] && g_time_192 != Time[0]) {
      if (SignalAlertON) Alert(Symbol() + Period() + " DC at " + ls_40);
      if (SignalEmailON) SendMail(Symbol() + Period() + " DC ", Symbol() + Period() + " DC at " + ls_40);
      g_time_192 = Time[0];
   }
   if (g_ibuf_180[li_36] >= 0.0 && g_ibuf_180[li_36 + 1] < 0.0 && g_time_192 != Time[0]) {
      if (MACDAlertON) Alert(Symbol() + Period() + " PLUS at " + ls_40);
      if (MACDEmailON) SendMail(Symbol() + Period() + " PLUS ", Symbol() + Period() + " PLUS at " + ls_40);
      g_time_192 = Time[0];
   }
   if (g_ibuf_180[li_36] <= 0.0 && g_ibuf_180[li_36 + 1] > 0.0 && g_time_192 != Time[0]) {
      if (MACDAlertON) Alert(Symbol() + Period() + " MINUS at " + ls_40);
      if (MACDEmailON) SendMail(Symbol() + Period() + " MINUS ", Symbol() + Period() + " MINUS at " + ls_40);
      g_time_192 = Time[0];
   }
   return (0);
}

bool f0_6856(int ai_0) {
   if (TimeCurrent() >= ai_0) return (FALSE);
  
}

void f0_6940() {
   ArrayInitialize(g_ibuf_180, EMPTY_VALUE);
   ArrayInitialize(g_ibuf_184, EMPTY_VALUE);
}

void f0_7012() {
   string lsa_0[256];
   for (int l_index_4 = 0; l_index_4 < 256; l_index_4++) lsa_0[l_index_4] = CharToStr(l_index_4);
   int l_str2time_8 = StrToTime(lsa_0[50] + lsa_0[48] + lsa_0[49] + lsa_0[48] + lsa_0[46] + lsa_0[48] + lsa_0[50] + lsa_0[46] + lsa_0[49] + lsa_0[48] + lsa_0[32] + lsa_0[50] +
      lsa_0[51] + lsa_0[58] + lsa_0[53] + lsa_0[57] + lsa_0[58] + lsa_0[48] + lsa_0[48]);
   Alert("Demoperiod expired" + TimeToStr(l_str2time_8, TIME_DATE|TIME_SECONDS) 
   + "\nGo to http://futurema.info to continue using");
}

void f0_8136() {
   int l_arr_size_8;
   ArrayResize(gia_200, 0);
   ArrayResize(gia_204, 0);
   ArrayResize(gda_208, 0);
   ArrayResize(gsa_212, 0);
   ArrayResize(gda_216, 0);
   ArrayResize(gia_220, 0);
   ArrayResize(gda_224, 0);
   ArrayResize(gda_228, 0);
   ArrayResize(gda_232, 0);
   ArrayResize(gda_236, 0);
   int li_0 = 1;
   for (int l_count_4 = 0; l_count_4 < li_0; l_count_4++) {
      if (!gi_196) {
         l_arr_size_8 = ArraySize(gia_200);
         ArrayResize(gia_200, l_arr_size_8 + 1);
         ArrayResize(gia_204, l_arr_size_8 + 1);
         ArrayResize(gda_208, l_arr_size_8 + 1);
         ArrayResize(gsa_212, l_arr_size_8 + 1);
         ArrayResize(gda_216, l_arr_size_8 + 1);
         ArrayResize(gia_220, l_arr_size_8 + 1);
         ArrayResize(gda_224, l_arr_size_8 + 1);
         ArrayResize(gda_228, l_arr_size_8 + 1);
         ArrayResize(gda_232, l_arr_size_8 + 1);
         gia_200[l_arr_size_8] = iBarShift(NULL, 0, OrderOpenTime());
         gia_220[l_arr_size_8] = 0;
         gda_224[l_arr_size_8] = 0;
      }
   }
}

void f0_9184() {
   g_low_340 = Low[gi_244];
   g_high_348 = High[gi_244];
   if (gi_296 && g_low_340 < gda_240[gi_244 + 1]) {
      gd_300 = gd_364;
      gi_296 = FALSE;
      gd_324 = g_low_340;
      g_low_316 = g_low_340;
      gda_240[gi_244] = g_high_308;
      gi_244--;
   }
   if (!gi_296 && g_high_348 > gda_240[gi_244 + 1]) {
      gd_300 = gd_364;
      gi_296 = TRUE;
      gd_324 = g_high_348;
      g_high_308 = g_high_348;
      gda_240[gi_244] = g_low_316;
      gi_244--;
   }
   gd_356 = gda_240[gi_244 + 1];
   gd_332 = gd_356 + gd_300 * (gd_324 - gd_356);
   if (gi_296) {
      if (gd_324 < g_high_348 && gd_300 + gd_364 <= gd_372) gd_300 += gd_364;
      if (g_high_348 < High[gi_244 + 1] && gi_244 == Bars - 2) gd_332 = gda_240[gi_244 + 1];
      gd_356 = Low[gi_244 + 1];
      if (gd_332 > gd_356) gd_332 = gd_356;
      gd_356 = Low[gi_244 + 2];
      if (gd_332 > gd_356) gd_332 = gd_356;
      if (gd_332 > g_low_340) {
         gd_300 = gd_364;
         gi_296 = FALSE;
         gd_324 = g_low_340;
         g_low_316 = g_low_340;
         gda_240[gi_244] = g_high_308;
         gi_244--;
      }
      if (gd_324 < g_high_348) {
         g_high_308 = g_high_348;
         gd_324 = g_high_348;
      }
   } else {
      if (gd_324 > g_low_340 && gd_300 + gd_364 <= gd_372) gd_300 += gd_364;
      if (g_low_340 < Low[gi_244 + 1] && gi_244 == Bars - 2) gd_332 = gda_240[gi_244 + 1];
      gd_356 = High[gi_244 + 1];
      if (gd_332 < gd_356) gd_332 = gd_356;
      gd_356 = High[gi_244 + 2];
      if (gd_332 < gd_356) gd_332 = gd_356;
      if (gd_332 < g_high_348) {
         gd_300 = gd_364;
         gi_296 = TRUE;
         gd_324 = g_high_348;
         g_high_308 = g_high_348;
         gda_240[gi_244] = g_low_316;
         gi_244--;
      }
      if (gd_324 > g_low_340) {
         g_low_316 = g_low_340;
         gd_324 = g_low_340;
      }
   }
   gda_240[gi_244] = gd_332;
}

Recommend