Navigation:Home > Content >

ForexReplicator_EURUSD.mq4

Time: 2010-11-09 | Download file:ForexReplicator_EURUSD.mq4

#property copyright "Copyright © 2012, Forex Replicator. http://forexreplicator.com"
#property link      "http://forexreplicator.com"

#property indicator_separate_window
#property indicator_minimum -1.0
#property indicator_maximum 110.0
#property indicator_buffers 8
#property indicator_color1 Black
#property indicator_color2 Black
#property indicator_color3 Black
#property indicator_color4 Black
#property indicator_color5 Black
#property indicator_color6 Black
#property indicator_color7 Black
#property indicator_color8 Black

#include 
#import "user32.dll"
   int GetDC(int a0);
   int ReleaseDC(int a0, int a1);
#import "gdi32.dll"
   int GetPixel(int a0, int a1, int a2);
#import "ForexReplicator_EURUSD.dll"
   int initial_market(string a0);
   int listen_market(double& a0[], int a1, double& a2[], int a3, double& a4[], int a5, double& a6[], int a7, double& a8[], int a9, double& a10[], int a11, int a12, int a13, int a14, int a15, int a16, string a17);
   double gdaa();
#import

double g_ibuf_76[];
double gda_80[];
double g_ibuf_84[];
double g_ibuf_88[];
double g_ibuf_92[];
double g_ibuf_96[];
double g_ibuf_100[];
double g_ibuf_104[];
double g_ibuf_108[];
int gi_112 = 1;
int gia_116[];
double gda_120[];
extern int ChartLength = 50;
extern int Forecast = 10;
extern int SearchLength = 3000;
int g_color_136 = MintCream;
int g_color_140 = MediumSeaGreen;
int g_color_144 = DarkGreen;
int g_color_148 = DarkGreen;
int g_color_152 = Red;
int g_color_156 = Brown;
int gi_160 = 3;
string g_fontname_164 = "Small Fonts";
extern int FontSize = 12;
string gs_176 = "ForexReplicator";
double gd_184;
double gd_192;
int gi_200 = -1;
extern string ClickBankReceipt = "";
double gda_212[][6];
double gda_216[][6];
double gda_220[][6];
double gda_224[][6];
double gda_228[][6];
double gda_232[][6];
int gi_240;
int gi_244;
int gi_248;
int gi_252;
int gi_256;
int gi_260;

int f0_1() {
   int li_0 = WindowHandle(Symbol(), Period());
   int li_4 = GetDC(li_0);
   int li_ret_8 = GetPixel(li_4, 1, 2);
   ReleaseDC(li_0, li_4);
   return (li_ret_8);
}

int deinit() {
   for (int li_0 = 0; li_0 < ObjectsTotal(); li_0++) {
      if (StringFind(ObjectName(li_0), gs_176) == 0) {
         ObjectDelete(ObjectName(li_0));
         li_0--;
      }
   }
   return (0);
}

int init() {
   int li_0 = initial_market(ClickBankReceipt);
   if (li_0 == 1) Alert("Account Is Verified");
   if (li_0 != 1) Alert("Account not valid, please make sure you activate your account and enter your receipt in the settings");
   if (SearchLength > Bars) SearchLength = Bars - 1;
   if (SearchLength < 7 * ChartLength) SearchLength = 7 * ChartLength;
   if (ChartLength > 300) ChartLength = 300;
   if (ChartLength <= 10) ChartLength = 10;
   if (Forecast <= 0 || Forecast > ChartLength) Forecast = ChartLength / 2;
   SetIndexBuffer(0, g_ibuf_76);
   SetIndexBuffer(1, g_ibuf_84);
   SetIndexBuffer(2, g_ibuf_88);
   SetIndexBuffer(3, g_ibuf_104);
   SetIndexBuffer(4, g_ibuf_108);
   SetIndexBuffer(5, g_ibuf_92);
   SetIndexBuffer(6, g_ibuf_96);
   SetIndexBuffer(7, g_ibuf_100);
   g_color_136 = f0_1();
   int li_4 = WindowHandle(Symbol(), Period());
   if (li_4 != 0) PostMessageA(li_4, WM_COMMAND, 33324, 0);
   for (int li_8 = 0; li_8 < 8; li_8++) SetIndexLabel(li_8, "");
   return (0);
}

int start() {
   int li_8;
   int li_12;
   int li_unused_16;
   string name_20;
   int li_28;
   string ls_unused_40;
   string ls_unused_48;
   string ls_unused_56;
   string ls_unused_64;
   string ls_unused_76;
   int window_84;
   int li_92;
   int li_96;
   int li_100;
   double ld_104;
   string ls_0 = StringSubstr(Symbol(), 0, 6);
   if (ls_0 != "EURUSD") {
      Alert("Pair not valid, please make sure you select correct pair");
      return (0);
   }
   if (gi_112 > 0) {
      if (WindowBarsPerChart() <= 0 || Period() <= 0 || Bars <= 0) return;
      li_8 = 0;
      li_unused_16 = Bars;
      li_28 = 0;
      gi_200 = TRUE;
      if (!gi_200 && li_28 < ChartLength) li_28 = ChartLength;
      g_color_136 = f0_1();
      IndicatorShortName(gs_176);
      window_84 = WindowFind(gs_176);
      if (window_84 > WindowsTotal() || window_84 < 0) return (9);
      name_20 = gs_176 + "_" + window_84;
      if (ChartLength <= 3) ChartLength = WindowBarsPerChart() / gi_112 - gi_112;
      li_12 = ChartLength + 3;
      for (int li_88 = 0; li_88 < ObjectsTotal(); li_88++) {
         if (StringFind(ObjectName(li_88), gs_176) == 0) {
            ObjectDelete(ObjectName(li_88));
            li_88--;
         }
      }
      ArrayInitialize(g_ibuf_76, EMPTY_VALUE);
      ArrayInitialize(g_ibuf_84, EMPTY_VALUE);
      ArrayInitialize(g_ibuf_88, EMPTY_VALUE);
      ArrayInitialize(g_ibuf_104, EMPTY_VALUE);
      ArrayInitialize(g_ibuf_108, EMPTY_VALUE);
      ArrayInitialize(g_ibuf_92, EMPTY_VALUE);
      ArrayInitialize(g_ibuf_96, EMPTY_VALUE);
      ArrayInitialize(g_ibuf_100, EMPTY_VALUE);
      gi_240 = ArrayCopyRates(gda_212, Symbol(), PERIOD_H4);
      gi_244 = ArrayCopyRates(gda_216, Symbol(), PERIOD_H1);
      gi_248 = ArrayCopyRates(gda_220, Symbol(), PERIOD_M30);
      gi_252 = ArrayCopyRates(gda_224, Symbol(), PERIOD_M15);
      gi_256 = ArrayCopyRates(gda_228, Symbol(), PERIOD_M5);
      gi_260 = ArrayCopyRates(gda_232, Symbol(), PERIOD_M1);
      if (Period() == PERIOD_H4) li_92 = 240;
      if (Period() == PERIOD_H1) li_92 = 60;
      if (Period() == PERIOD_M30) li_92 = 30;
      if (Period() == PERIOD_M15) li_92 = 15;
      if (Period() == PERIOD_M5) li_92 = 5;
      if (Period() == PERIOD_M1) li_92 = 1;
      li_96 = listen_market(gda_212, gi_240, gda_216, gi_244, gda_220, gi_248, gda_224, gi_252, gda_228, gi_256, gda_232, gi_260, li_28, ChartLength, SearchLength, li_92,
         Forecast, Symbol());
      gd_184 = -10000;
      gd_192 = 10000;
      for (li_88 = 0; li_88 < 8; li_88++) SetIndexShift(li_88, (-li_28) + 1 + Forecast);
      ArrayResize(gia_116, gi_112);
      ArrayResize(gda_120, gi_112);
      li_100 = 0;
      li_8 = li_96 - Forecast;
      g_ibuf_76[0] = 100.0 * gdaa();
      for (li_88 = 0; li_88 < ChartLength; li_88++) f0_0(li_8, li_88 + li_8, Symbol(), Period(), ChartLength, -li_8);
      ld_104 = gdaa();
      name_20 = gs_176 + window_84 + li_100;
      li_88 = ChartLength - 1;
      ObjectCreate(name_20, OBJ_TEXT, window_84, Time[li_88 + li_12 * li_100 + 3 - ChartLength / 2 - 2 + li_28 - Forecast], 110);
      ObjectSet(name_20, OBJPROP_BACK, FALSE);
      ObjectSetText(name_20, TimeToStr(Time[li_8 + Forecast]) + " - " + DoubleToStr(100.0 * ld_104, 1) + "%", FontSize, g_fontname_164, Red);
      gd_184 = MathMax(gd_184, 110);
      SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, gi_160, g_color_140);
      SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID, gi_160, g_color_144);
      SetIndexStyle(3, DRAW_HISTOGRAM, STYLE_SOLID, gi_160, g_color_152);
      SetIndexStyle(4, DRAW_HISTOGRAM, STYLE_SOLID, gi_160, g_color_156);
      SetIndexStyle(5, DRAW_HISTOGRAM, STYLE_SOLID, gi_160, g_color_136);
      SetIndexStyle(6, DRAW_HISTOGRAM, STYLE_SOLID, 1, g_color_148);
      SetIndexStyle(7, DRAW_HISTOGRAM, STYLE_SOLID, gi_160, g_color_136);
   }
   return (0);
}

void f0_0(int ai_0, int ai_4, string a_symbol_8, int a_timeframe_16, int ai_20, int ai_24) {
   double ld_28;
   double ld_36;
   double ld_44;
   double ld_52;
   double ld_60;
   double ihigh_68 = iHigh(a_symbol_8, a_timeframe_16, iHighest(a_symbol_8, a_timeframe_16, MODE_HIGH, ai_20, ai_0));
   double ilow_76 = iLow(a_symbol_8, a_timeframe_16, iLowest(a_symbol_8, a_timeframe_16, MODE_LOW, ai_20, ai_0));
   if (ihigh_68 != ilow_76) {
      ld_28 = ihigh_68 - ilow_76;
      ld_36 = 100.0 * ((iHigh(a_symbol_8, a_timeframe_16, ai_4) - ilow_76) / ld_28);
      ld_44 = 100.0 * ((iOpen(a_symbol_8, a_timeframe_16, ai_4) - ilow_76) / ld_28);
      ld_52 = 100.0 * ((iClose(a_symbol_8, a_timeframe_16, ai_4) - ilow_76) / ld_28);
      ld_60 = 100.0 * ((iLow(a_symbol_8, a_timeframe_16, ai_4) - ilow_76) / ld_28);
      ai_4++;
      ai_24 += 2;
      gda_80[ai_4 + ai_24] = ld_36;
      if (gd_184 < ld_36) gd_184 = ld_36;
      g_ibuf_100[ai_4 + ai_24] = ld_60;
      if (ld_60 < gd_192) gd_192 = ld_60;
      if ((ai_4 + ai_24) % (ai_20 + 3) < Forecast + 1) {
         if (ld_44 <= ld_52) {
            g_ibuf_104[ai_4 + ai_24] = ld_52;
            g_ibuf_92[ai_4 + ai_24] = ld_44;
         } else {
            g_ibuf_108[ai_4 + ai_24] = ld_44;
            g_ibuf_92[ai_4 + ai_24] = ld_52;
         }
      } else {
         if (ld_44 <= ld_52) {
            g_ibuf_84[ai_4 + ai_24] = ld_52;
            g_ibuf_92[ai_4 + ai_24] = ld_44;
         } else {
            g_ibuf_88[ai_4 + ai_24] = ld_44;
            g_ibuf_92[ai_4 + ai_24] = ld_52;
         }
      }
      g_ibuf_96[ai_4 + ai_24] = g_ibuf_92[ai_4 + ai_24];
   }
}

Recommend