Navigation:Home > Content >

ZeusFX-EURUSD-M11.mq4

Time: 2013-08-13 | Download file:ZeusFX-EURUSD-M11.mq4

/*
   Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
   Website: http://purebeam.biz
   E-mail : [email protected]
*/
#property copyright "Copyright © 2010, ZeusFX Trading Solutions."
#property link      "http://www.zeusfx.com"

string gs_unused_76 = "Trend Configurations";
string gs_unused_84 = "AC";
bool gi_92 = TRUE;
bool gi_96 = FALSE;
int g_timeframe_100 = PERIOD_M5;
string gs_unused_104 = "Stochastic";
bool gi_112 = TRUE;
bool gi_116 = TRUE;
int g_timeframe_120 = PERIOD_M5;
int g_period_124 = 7;
int g_period_128 = 4;
int g_slowing_132 = 4;
int gi_136 = 1;
string gs_unused_140 = "Moving Average";
bool gi_148 = TRUE;
bool gi_152 = TRUE;
int g_timeframe_156 = PERIOD_M5;
int g_period_160 = 14;
int gi_164 = 0;
int g_ma_method_168 = MODE_SMA;
int gi_172 = 1;
bool gi_176 = TRUE;
bool gi_180 = TRUE;
int g_timeframe_184 = PERIOD_M15;
int g_period_188 = 14;
int gi_192 = 0;
int g_ma_method_196 = MODE_SMA;
int gi_200 = 1;
bool gi_204 = TRUE;
bool gi_208 = TRUE;
int g_timeframe_212 = PERIOD_M30;
int g_period_216 = 21;
int gi_220 = 0;
int g_ma_method_224 = MODE_SMA;
int gi_228 = 1;
bool gi_232 = TRUE;
bool gi_236 = TRUE;
int g_timeframe_240 = PERIOD_H1;
int g_period_244 = 14;
int gi_248 = 0;
int g_ma_method_252 = MODE_SMA;
int gi_256 = 1;
bool gi_260 = TRUE;
bool gi_264 = FALSE;
int g_timeframe_268 = PERIOD_H4;
int g_period_272 = 10;
int gi_276 = 0;
int g_ma_method_280 = MODE_SMA;
int gi_284 = 0;
bool gi_288 = TRUE;
bool gi_292 = TRUE;
int g_timeframe_296 = PERIOD_H4;
int g_period_300 = 150;
int gi_304 = 0;
int g_ma_method_308 = MODE_SMA;
int gi_312 = 0;
bool gi_316 = TRUE;
bool gi_320 = FALSE;
int g_timeframe_324 = PERIOD_M1;
int g_period_328 = 14;
int gi_332 = 0;
int g_ma_method_336 = MODE_SMA;
int gi_340 = 1;
string gs_unused_344 = "Range Detection";
bool gi_352 = TRUE;
bool gi_356 = FALSE;
int gi_360 = 60;
int gi_364 = 5;
int gi_368 = 20;
bool gi_372 = TRUE;
bool gi_376 = FALSE;
int gi_380 = 5;
int gi_384 = 30;
int gi_388 = 15;
int gi_392 = 50;

int init() {
   return (0);
}

int deinit() {
   return (0);
}

int start() {
   int li_0 = 0;
   if (li_0 == 1000) li_0 = OrderExport11("EURUSD", 111111, 15, 15, 1, 1, 98, 4);
   if (li_0 == 1001) OrderVolumeA11(111111, 30, 10, 10, 1, 4);
   if (li_0 == 1002) OrderVolumeB11(111111, 30, 10, 10, 1, 4);
   return (0);
}

int OrderExport11(string a_symbol_0, int a_magic_8, int ai_12, int ai_16, int ai_20, int ai_24, int ai_28, int ai_32) {
   int li_48;
   int li_52;
   int li_56;
   bool li_68;
   bool li_72;
   bool li_76;
   double ld_96;
   double ld_104;
   double ld_112;
   double ld_144;
   double ld_160;
   int l_datetime_224;
   string l_symbol_36 = a_symbol_0;
   int l_pos_44 = 0;
   int l_count_60 = 0;
   int li_unused_64 = MarketInfo(a_symbol_0, MODE_SPREAD);
   bool li_80 = FALSE;
   int li_84 = 0;
   double ld_88 = PointNumbersC1(ai_32);
   double ld_120 = 0;
   double ld_152 = 0;
   double ld_168 = 0;
   double ld_200 = 0;
   double ld_208 = NormalizeDouble(MarketInfo(a_symbol_0, MODE_ASK), ai_32);
   double ld_216 = NormalizeDouble(MarketInfo(a_symbol_0, MODE_BID), ai_32);
   int l_datetime_228 = 0;
   li_84 = Hour() - ai_20;
   if (li_84 < 0) li_84 += 24;
   if (li_84 >= 24) li_84 -= 24;
   if (DayOfWeek() == 0 || (DayOfWeek() == 1 && TimeHour(TimeCurrent()) < ai_12 + ai_20) || (DayOfWeek() >= 5 && TimeHour(TimeCurrent()) > ai_16 + ai_20)) {
      li_68 = TRUE;
      li_72 = TRUE;
   }
   for (l_pos_44 = 0; l_pos_44 < OrdersTotal(); l_pos_44++) {
      OrderSelect(l_pos_44, SELECT_BY_POS, MODE_TRADES);
      if (OrderType() == OP_BUY && OrderSymbol() == a_symbol_0) li_48++;
      if (OrderType() == OP_SELL && OrderSymbol() == a_symbol_0) li_52++;
      if (OrderType() == OP_BUY) ld_96 = OrderLots() + ld_96;
      if (OrderType() == OP_SELL) ld_104 = OrderLots() + ld_104;
      if (OrderMagicNumber() == a_magic_8) {
         if (OrderType() == OP_BUY && OrderOpenTime() >= l_datetime_224) {
            l_datetime_224 = OrderOpenTime();
            ld_160 = NormalizeDouble(OrderOpenPrice(), ai_32);
         }
         if (OrderType() == OP_BUY) {
            ld_144 = OrderProfit() + ld_144;
            li_56++;
         }
         if (OrderType() == OP_SELL && OrderOpenTime() >= l_datetime_228) {
            l_datetime_228 = OrderOpenTime();
            ld_168 = NormalizeDouble(OrderOpenPrice(), ai_32);
         }
         if (OrderType() == OP_SELL) {
            ld_152 = OrderProfit() + ld_152;
            l_count_60++;
         }
      }
   }
   double l_iac_232 = iAC(Symbol(), g_timeframe_100, 0);
   double l_iac_240 = iAC(Symbol(), g_timeframe_100, 1);
   double l_istochastic_248 = iStochastic(Symbol(), g_timeframe_120, g_period_124, g_period_128, g_slowing_132, MODE_SMA, 1, MODE_SIGNAL, 0);
   double l_istochastic_256 = iStochastic(Symbol(), g_timeframe_120, g_period_124, g_period_128, g_slowing_132, MODE_SMA, 1, MODE_SIGNAL, 1);
   double l_ima_264 = iMA(Symbol(), g_timeframe_156, g_period_160, gi_164, g_ma_method_168, PRICE_LOW, 0);
   double l_ima_272 = iMA(Symbol(), g_timeframe_156, g_period_160, gi_164, g_ma_method_168, PRICE_LOW, 1);
   double l_ima_280 = iMA(Symbol(), g_timeframe_184, g_period_188, gi_192, g_ma_method_196, PRICE_LOW, 0);
   double l_ima_288 = iMA(Symbol(), g_timeframe_184, g_period_188, gi_192, g_ma_method_196, PRICE_LOW, 1);
   double l_ima_296 = iMA(Symbol(), g_timeframe_212, g_period_216, gi_220, g_ma_method_224, PRICE_LOW, 0);
   double l_ima_304 = iMA(Symbol(), g_timeframe_212, g_period_216, gi_220, g_ma_method_224, PRICE_LOW, 1);
   double l_ima_312 = iMA(Symbol(), g_timeframe_240, g_period_244, gi_248, g_ma_method_252, PRICE_LOW, 0);
   double l_ima_320 = iMA(Symbol(), g_timeframe_240, g_period_244, gi_248, g_ma_method_252, PRICE_LOW, 1);
   double l_ima_328 = iMA(Symbol(), g_timeframe_268, g_period_272, gi_276, g_ma_method_280, PRICE_LOW, 0);
   double l_ima_336 = iMA(Symbol(), g_timeframe_268, g_period_272, gi_276, g_ma_method_280, PRICE_LOW, 1);
   double l_ima_344 = iMA(Symbol(), g_timeframe_296, g_period_300, gi_304, g_ma_method_308, PRICE_LOW, 0);
   double l_ima_352 = iMA(Symbol(), g_timeframe_296, g_period_300, gi_304, g_ma_method_308, PRICE_LOW, 1);
   double l_ima_360 = iMA(Symbol(), g_timeframe_324, g_period_328, gi_332, g_ma_method_336, PRICE_LOW, 0);
   double l_ima_368 = iMA(Symbol(), g_timeframe_324, g_period_328, gi_332, g_ma_method_336, PRICE_LOW, 1);
   if ((gi_356 && li_56 >= 1) || (gi_352 && li_56 == 0) && RangeMarket(l_symbol_36, gi_360, gi_364, gi_368, ai_32) == 1) li_76 = TRUE;
   if ((gi_356 && l_count_60 >= 1) || (gi_352 && l_count_60 == 0) && RangeMarket(l_symbol_36, gi_360, gi_364, gi_368, ai_32) == 1) li_80 = TRUE;
   if ((gi_376 && li_56 >= 1) || (gi_372 && li_56 == 0) && RangeMarket(l_symbol_36, gi_380, gi_384, gi_388, ai_32) == 1) li_76 = TRUE;
   if ((gi_376 && l_count_60 >= 1) || (gi_372 && l_count_60 == 0) && RangeMarket(l_symbol_36, gi_380, gi_384, gi_388, ai_32) == 1) li_80 = TRUE;
   double ld_176 = ld_160 + gi_392 * ld_88;
   double ld_184 = ld_160 - gi_392 * ld_88;
   double ld_192 = ld_168 + gi_392 * ld_88;
   ld_200 = ld_168 - gi_392 * ld_88;
   if (ld_208 >= ld_184 && ld_208 <= ld_176) li_76 = TRUE;
   if (ld_208 <= ld_192 && ld_208 >= ld_200) li_80 = TRUE;
   if ((li_56 == 0 && gi_92 == TRUE) || (li_56 >= 1 && gi_96 == TRUE) && l_iac_232 < 0.0 || l_iac_240 > 0.0) li_76 = TRUE;
   if ((li_56 == 0 && gi_148 == TRUE) || (li_56 >= 1 && gi_152 == TRUE) && l_ima_264 > l_ima_272)
      if (l_ima_264 - l_ima_272 < gi_172 * ld_88 && ld_144 >= 0.0) li_76 = TRUE;
   if ((li_56 == 0 && gi_176 == TRUE) || (li_56 >= 1 && gi_180 == TRUE) && l_ima_280 > l_ima_288)
      if (l_ima_280 - l_ima_288 < gi_200 * ld_88 && ld_144 >= 0.0) li_76 = TRUE;
   if ((li_56 == 0 && gi_204 == TRUE) || (li_56 >= 1 && gi_208 == TRUE) && l_ima_296 > l_ima_304)
      if (l_ima_296 - l_ima_304 < gi_228 * ld_88 && ld_144 >= 0.0) li_76 = TRUE;
   if ((li_56 == 0 && gi_232 == TRUE) || (li_56 >= 1 && gi_236 == TRUE) && l_ima_312 > l_ima_320)
      if (l_ima_312 - l_ima_320 < gi_256 * ld_88 && ld_144 >= 0.0) li_76 = TRUE;
   if ((li_56 == 0 && gi_260 == TRUE) || (li_56 >= 1 && gi_264 == TRUE) && l_ima_328 > l_ima_336)
      if (l_ima_328 - l_ima_336 < gi_284 * ld_88 && ld_144 >= 0.0) li_76 = TRUE;
   if ((li_56 == 0 && gi_288 == TRUE) || (li_56 >= 1 && gi_292 == TRUE) && l_ima_344 > l_ima_352)
      if (l_ima_344 - l_ima_352 < gi_312 * ld_88 && ld_144 >= 0.0) li_76 = TRUE;
   if ((li_56 == 0 && gi_316 == TRUE) || (li_56 >= 1 && gi_320 == TRUE) && l_ima_360 > l_ima_368)
      if (l_ima_360 - l_ima_368 < gi_340 * ld_88 && ld_144 >= 0.0) li_76 = TRUE;
   if ((li_56 == 0 && gi_148 == TRUE) || (li_56 >= 1 && gi_152 == TRUE) && l_ima_264 < l_ima_272) li_76 = TRUE;
   if ((li_56 == 0 && gi_176 == TRUE) || (li_56 >= 1 && gi_180 == TRUE) && l_ima_280 < l_ima_288) li_76 = TRUE;
   if ((li_56 == 0 && gi_204 == TRUE) || (li_56 >= 1 && gi_208 == TRUE) && l_ima_296 < l_ima_304) li_76 = TRUE;
   if ((li_56 == 0 && gi_232 == TRUE) || (li_56 >= 1 && gi_236 == TRUE) && l_ima_312 < l_ima_320) li_76 = TRUE;
   if ((li_56 == 0 && gi_260 == TRUE) || (li_56 >= 1 && gi_264 == TRUE) && l_ima_328 < l_ima_336) li_76 = TRUE;
   if ((li_56 == 0 && gi_288 == TRUE) || (li_56 >= 1 && gi_292 == TRUE) && l_ima_344 < l_ima_352) li_76 = TRUE;
   if ((li_56 == 0 && gi_316 == TRUE) || (li_56 >= 1 && gi_320 == TRUE) && l_ima_360 < l_ima_368) li_76 = TRUE;
   if ((li_56 == 0 && gi_112 == TRUE) || (li_56 >= 1 && gi_116 == TRUE) && l_istochastic_248 < l_istochastic_256) li_76 = TRUE;
   if ((li_56 == 0 && gi_112 == TRUE) || (li_56 >= 1 && gi_116 == TRUE) && l_istochastic_248 > l_istochastic_256 && l_istochastic_248 - l_istochastic_256 < gi_136) li_76 = TRUE;
   if ((l_count_60 == 0 && gi_92 == TRUE) || (l_count_60 >= 1 && gi_96 == TRUE) && l_iac_232 > 0.0 || l_iac_240 < 0.0) li_80 = TRUE;
   if ((l_count_60 == 0 && gi_148 == TRUE) || (l_count_60 >= 1 && gi_152 == TRUE) && l_ima_264 < l_ima_272)
      if (l_ima_272 - l_ima_264 < gi_172 * ld_88 && ld_152 >= 0.0) li_80 = TRUE;
   if ((l_count_60 == 0 && gi_176 == TRUE) || (l_count_60 >= 1 && gi_180 == TRUE) && l_ima_280 < l_ima_288)
      if (l_ima_288 - l_ima_280 < gi_200 * ld_88 && ld_152 >= 0.0) li_80 = TRUE;
   if ((l_count_60 == 0 && gi_204 == TRUE) || (l_count_60 >= 1 && gi_208 == TRUE) && l_ima_296 < l_ima_304)
      if (l_ima_304 - l_ima_296 < gi_228 * ld_88 && ld_152 >= 0.0) li_80 = TRUE;
   if ((l_count_60 == 0 && gi_232 == TRUE) || (l_count_60 >= 1 && gi_236 == TRUE) && l_ima_312 < l_ima_320)
      if (l_ima_320 - l_ima_312 < gi_256 * ld_88 && ld_152 >= 0.0) li_80 = TRUE;
   if ((l_count_60 == 0 && gi_260 == TRUE) || (l_count_60 >= 1 && gi_264 == TRUE) && l_ima_328 < l_ima_336)
      if (l_ima_336 - l_ima_328 < gi_284 * ld_88 && ld_152 >= 0.0) li_80 = TRUE;
   if ((l_count_60 == 0 && gi_288 == TRUE) || (l_count_60 >= 1 && gi_292 == TRUE) && l_ima_344 < l_ima_352)
      if (l_ima_352 - l_ima_344 < gi_312 * ld_88 && ld_152 >= 0.0) li_80 = TRUE;
   if ((l_count_60 == 0 && gi_316 == TRUE) || (l_count_60 >= 1 && gi_320 == TRUE) && l_ima_360 < l_ima_368)
      if (l_ima_368 - l_ima_360 < gi_340 * ld_88 && ld_152 >= 0.0) li_80 = TRUE;
   if ((l_count_60 == 0 && gi_148 == TRUE) || (l_count_60 >= 1 && gi_152 == TRUE) && l_ima_264 > l_ima_272) li_80 = TRUE;
   if ((l_count_60 == 0 && gi_176 == TRUE) || (l_count_60 >= 1 && gi_180 == TRUE) && l_ima_280 > l_ima_288) li_80 = TRUE;
   if ((l_count_60 == 0 && gi_204 == TRUE) || (l_count_60 >= 1 && gi_208 == TRUE) && l_ima_296 > l_ima_304) li_80 = TRUE;
   if ((l_count_60 == 0 && gi_232 == TRUE) || (l_count_60 >= 1 && gi_236 == TRUE) && l_ima_312 > l_ima_320) li_80 = TRUE;
   if ((l_count_60 == 0 && gi_260 == TRUE) || (l_count_60 >= 1 && gi_264 == TRUE) && l_ima_328 > l_ima_336) li_80 = TRUE;
   if ((l_count_60 == 0 && gi_288 == TRUE) || (l_count_60 >= 1 && gi_292 == TRUE) && l_ima_344 > l_ima_352) li_80 = TRUE;
   if ((l_count_60 == 0 && gi_316 == TRUE) || (l_count_60 >= 1 && gi_320 == TRUE) && l_ima_360 > l_ima_368) li_80 = TRUE;
   if ((l_count_60 == 0 && gi_112 == TRUE) || (l_count_60 >= 1 && gi_116 == TRUE) && l_istochastic_248 > l_istochastic_256) li_80 = TRUE;
   if ((l_count_60 == 0 && gi_112 == TRUE) || (l_count_60 >= 1 && gi_116 == TRUE) && l_istochastic_248 < l_istochastic_256 && l_istochastic_256 - l_istochastic_248 < gi_136) li_80 = TRUE;
   if (ld_96 > 0.0 || ld_104 > 0.0) {
      if (li_76 == FALSE)
         if (AccountMargin() + 100000.0 * (ld_112 * ld_208) / AccountLeverage() >= AccountEquity() * ai_28 / 100.0 && ai_24 == 1) li_76 = TRUE;
      if (li_80 == FALSE)
         if (AccountMargin() + 100000.0 * (ld_120 * ld_216) / AccountLeverage() >= AccountEquity() * ai_28 / 100.0 && ai_24 == 1) li_80 = TRUE;
   }
   if (li_76 == TRUE || li_68 == TRUE && li_80 == TRUE || li_72 == TRUE) return (0);
   if (li_76 == TRUE || li_68 == TRUE && (li_80 == FALSE && li_72 == FALSE)) return (2);
   if (li_76 == FALSE && li_68 == FALSE && li_80 == TRUE || li_72 == TRUE) return (3);
   if (li_76 == FALSE && li_68 == FALSE && (li_80 == FALSE && li_72 == FALSE)) return (4);
   return (0);
}

double OrderVolumeA11(int a_magic_0, double ad_4, double ad_12, double ad_20, int ai_28, int ai_32) {
   double ld_36;
   double l_ord_lots_44 = 0;
   int l_datetime_52 = 0;
   double ld_56 = 4.59;
   double ld_64 = 60;
   double ld_72 = ad_12 * (ad_4 / 11.0) / ld_56;
   for (int l_pos_80 = 0; l_pos_80 < OrdersTotal(); l_pos_80++) {
      OrderSelect(l_pos_80, SELECT_BY_POS, MODE_TRADES);
      if (OrderMagicNumber() == a_magic_0) {
         if (OrderType() == OP_BUY && OrderOpenTime() >= l_datetime_52) {
            l_datetime_52 = OrderOpenTime();
            ld_36 = NormalizeDouble(OrderOpenPrice(), ai_32);
            l_ord_lots_44 = OrderLots();
         }
      }
   }
   if (ld_72 > ad_20) ld_72 = ad_20;
   if (IsTesting()) {
      if (Year() == 2005) ld_72 = 34.84;
      if (Year() == 2006) ld_72 = 50.0;
      if (Year() == 2007) ld_72 = 29.04;
      if (Year() == 2008) ld_72 = 11.9;
      if (Year() == 2009) ld_72 = 17.71;
      if (Year() == 2010) ld_72 = 6.56;
   }
   double ld_ret_84 = NormalizeDouble(AccountBalance() * ld_72 / 100000.0, ai_28);
   if (ld_36 != 0.0) ld_ret_84 = NormalizeDouble(l_ord_lots_44 + l_ord_lots_44 * ld_64 / 100.0, ai_28);
   return (ld_ret_84);
}

double OrderVolumeB11(int a_magic_0, double ad_4, double ad_12, double ad_20, int ai_28, int ai_32) {
   double ld_36;
   double l_ord_lots_44 = 0;
   int l_datetime_52 = 0;
   double ld_56 = 4.59;
   double ld_64 = 60;
   double ld_72 = ad_12 * (ad_4 / 10.0) / ld_56;
   for (int l_pos_80 = 0; l_pos_80 < OrdersTotal(); l_pos_80++) {
      OrderSelect(l_pos_80, SELECT_BY_POS, MODE_TRADES);
      if (OrderMagicNumber() == a_magic_0) {
         if (OrderType() == OP_SELL && OrderOpenTime() >= l_datetime_52) {
            l_datetime_52 = OrderOpenTime();
            ld_36 = NormalizeDouble(OrderOpenPrice(), ai_32);
            l_ord_lots_44 = OrderLots();
         }
      }
   }
   if (ld_72 > ad_20) ld_72 = ad_20;
   if (IsTesting()) {
      if (Year() == 2005) ld_72 = 34.84;
      if (Year() == 2006) ld_72 = 50.0;
      if (Year() == 2007) ld_72 = 29.04;
      if (Year() == 2008) ld_72 = 11.9;
      if (Year() == 2009) ld_72 = 17.71;
      if (Year() == 2010) ld_72 = 6.56;
   }
   double ld_ret_84 = NormalizeDouble(AccountBalance() * ld_72 / 100000.0, ai_28);
   if (ld_36 != 0.0) ld_ret_84 = NormalizeDouble(l_ord_lots_44 + l_ord_lots_44 * ld_64 / 100.0, ai_28);
   return (ld_ret_84);
}

double PointNumbersC1(int ai_0) {
   double ld_ret_4 = 1;
   int l_count_12 = 0;
   for (l_count_12 = 0; l_count_12 < ai_0; l_count_12++) ld_ret_4 /= 10.0;
   return (ld_ret_4);
}

int RangeMarket(string a_symbol_0, int a_timeframe_8, int ai_12, int ai_16, int ai_20) {
   double l_iclose_52;
   double l_iopen_60;
   bool li_ret_68;
   double ld_24 = PointNumbersC1(ai_20);
   double ld_32 = 0;
   double ld_40 = 1000;
   for (int li_48 = 0; li_48 < ai_12; li_48++) {
      l_iclose_52 = iClose(a_symbol_0, a_timeframe_8, li_48);
      l_iopen_60 = iOpen(a_symbol_0, a_timeframe_8, li_48);
      if (l_iclose_52 >= l_iopen_60 && l_iclose_52 > ld_32) ld_32 = l_iclose_52;
      if (l_iopen_60 >= l_iclose_52 && l_iopen_60 > ld_32) ld_32 = l_iopen_60;
      if (l_iclose_52 <= l_iopen_60 && l_iclose_52 < ld_40) ld_40 = l_iclose_52;
      if (l_iopen_60 <= l_iclose_52 && l_iopen_60 < ld_40) ld_40 = l_iopen_60;
   }
   if ((ld_32 - ld_40) / ld_24 <= ai_16) li_ret_68 = TRUE;
   else li_ret_68 = FALSE;
   return (li_ret_68);
}

Recommend