/*
Generated by EX4-TO-MQ4 decompiler V4.0.427.4 [-]
Website: https://purebeam.biz
E-mail : purebeam@gmail.com2012-10-19 by Capella at http://www.worldwide-invest.org
– Forced actrivation, removed demo restriction, removed expiration date
*/
#property copyright “Copyright ?2010, AeronInfo.Com”
#property link “http://www.aeroninfo.com”extern int MagicNumber = 1237321;
extern double Lots = 0.5;
extern bool AutoLots = TRUE;
extern double Equity_for_Lots = 10.0;
extern double LotsMultiplier = 1.5;
extern int Distance = 0;
extern double DistanceMultiplier = 0.75;
extern int Profit = 0;
extern double ProfitMultiplier = 1.5;
extern double MaximumLots = 0.0;
extern int TotalPositions = 10;
extern int ResetDays = 30;
extern int ResetProfit = 100;
extern int ResetLoss = 100;
extern bool AutoDilute = FALSE;
extern int StartHour = 0;
extern int EndHour = 24;
extern string Comments = “Aeron-AllPairs-2012-v2”;string UnlockCode = “1234567890”;
double g_lots_184;
int gi_192;
int gi_196;
bool gi_200;
double gd_216;
int gi_unused_224 = 1;
double gd_unused_228;
int g_datetime_236;
int g_datetime_240;
int gi_unused_248 = 2000;
int gi_unused_252;
int gi_unused_256;
int gi_unused_260;
int g_count_264;
int g_count_268;
int g_count_272;
int g_count_276;
int g_count_280;
int g_count_284;
int gi_288;
double gd_292;
double g_order_lots_300;
double g_order_lots_308;
double g_order_open_price_316;
int g_ticket_324;
int g_ticket_328;
string gs_332;
string gs_340;
int g_datetime_348;
int g_pos_352;int init() {
g_datetime_348 = TimeCurrent();
gi_unused_256 = 0;
gi_unused_252 = 0;
g_datetime_236 = 86400;
gd_unused_228 = LotsMultiplier;
gi_unused_260 = 1;
if (Distance == 0) {
if (MarketInfo(Symbol(), MODE_DIGITS) == 5.0 || MarketInfo(Symbol(), MODE_DIGITS) == 3.0) Distance = 25.0 * MathMax(3, MarketInfo(Symbol(), MODE_SPREAD) / 10.0);
if (MarketInfo(Symbol(), MODE_DIGITS) == 4.0 || MarketInfo(Symbol(), MODE_DIGITS) == 2.0) Distance = 25.0 * MathMax(3, MarketInfo(Symbol(), MODE_SPREAD));
}
if (AutoLots == TRUE) {
Lots = AccountEquity() * (Equity_for_Lots / 100.0) / (MarketInfo(Symbol(), MODE_MARGINREQUIRED) * MarketInfo(Symbol(), MODE_MINLOT)) * MarketInfo(Symbol(), MODE_MINLOT) / 5.0;
if (Lots < MarketInfo(Symbol(), MODE_MINLOT)) Lots = MarketInfo(Symbol(), MODE_MINLOT);
if (MarketInfo(Symbol(), MODE_LOTSTEP) == 0.01) Lots = NormalizeDouble(Lots, 2);
else
if (MarketInfo(Symbol(), MODE_LOTSTEP) == 0.05 || MarketInfo(Symbol(), MODE_LOTSTEP) == 0.1) Lots = NormalizeDouble(Lots, 1);
}
if (MaximumLots == 0.0) MaximumLots = 25.0 * Lots;
if (Profit == 0 && MarketInfo(Symbol(), MODE_DIGITS) == 5.0 || MarketInfo(Symbol(), MODE_DIGITS) == 3.0) {
Profit = 20.0 * MarketInfo(Symbol(), MODE_TICKVALUE) * (Lots / 0.1);
if (Profit == 0.0) Profit = 1.0;
}
if (MarketInfo(Symbol(), MODE_DIGITS) == 5.0) gd_216 = 0.0001;
if (MarketInfo(Symbol(), MODE_DIGITS) == 4.0) gd_216 = 0.0001;
if (MarketInfo(Symbol(), MODE_DIGITS) == 3.0) gd_216 = 0.01;
if (MarketInfo(Symbol(), MODE_DIGITS) == 2.0) gd_216 = 0.01;
if (Profit == 0 && MarketInfo(Symbol(), MODE_DIGITS) == 4.0 || MarketInfo(Symbol(), MODE_DIGITS) == 2.0) {
Profit = 2.0 * MarketInfo(Symbol(), MODE_TICKVALUE) * (Lots / 0.1);
if (Profit == 0.0) Profit = 1.0;
}
gi_192 = Profit;
gi_196 = Distance;
return (0);
}int deinit() {
return (0);
}int start() {
double str2dbl_16;
double ld_24;
double str_len_32;
double str2dbl_40;
double str2dbl_48;
double str2dbl_56;
string acc_number_64;
// if (IsTesting())
// if (Year() < 2012) return (0);
bool li_12 = TRUE; // Forced to true
int li_0 = 31;
int li_4 = 10;
int li_8 = 2012;
if (Year() < li_8) li_12 = TRUE;
if (Year() == li_8 && Month() < li_4) li_12 = TRUE;
if (Year() == li_8 && Month() == li_4 && Day() <= li_0) li_12 = TRUE;
if (li_12 != TRUE) {
Alert(“License Expired”);
return (0);
}
if (Lots == 0.0) Lots = 2.0 * MarketInfo(Symbol(), MODE_MINLOT);
if (IsDemo() == FALSE) {
str2dbl_16 = StrToDouble(UnlockCode);
acc_number_64 = AccountNumber();
str_len_32 = StringLen(acc_number_64);
str2dbl_40 = StrToDouble(StringSubstr(acc_number_64, 0, 1));
str2dbl_48 = StrToDouble(StringSubstr(acc_number_64, 1, 1));
str2dbl_56 = StrToDouble(StringSubstr(acc_number_64, str_len_32 – 1.0, 1));
ld_24 = AccountNumber() + 849;
ld_24 = ld_24 + 189.0 * str2dbl_40 + 278.0 * str2dbl_48 + 118.0 * str2dbl_56;
}
str2dbl_16 = ld_24; // Forced to activation
if (IsDemo() == FALSE && str2dbl_16 != ld_24) {
Alert(“Activate Aeron EA\nfor this Real Account”);
return (0);
}
double ld_76 = 0.0;
for (int pos_72 = 0; pos_72 <= OrdersTotal() – 1; pos_72++) {
OrderSelect(pos_72, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) ld_76 += OrderProfit();
}
if (TimeCurrent() – g_datetime_348 >= 60 * (60 * (24 * ResetDays))) gi_200 = TRUE;
if (ld_76 > AccountBalance() * ResetProfit / 100.0 || ld_76 < (-1.0 * AccountBalance()) * ResetLoss / 100.0) gi_200 = TRUE;
double ima_84 = 0.0;
ima_84 = iMA(Symbol(), 0, 14, 0, MODE_SMA, PRICE_CLOSE, 0);
f0_0();
if (gi_288 == 0 && gi_288 < TotalPositions) {
if (Ask > ima_84 && TimeHour(TimeCurrent()) >= StartHour && TimeHour(TimeCurrent()) <= EndHour) {
for (g_pos_352 = 1; g_pos_352 <= 10; g_pos_352++)
if (OrderSend(Symbol(), OP_BUY, Lots, NormalizeDouble(Ask, Digits), 2, 0, 0, Comments, MagicNumber, 0, Green) > 0) return (0);
}
}
f0_0();
if (gi_288 == 0 && gi_288 < TotalPositions) {
if (Bid < ima_84 && TimeHour(TimeCurrent()) >= StartHour && TimeHour(TimeCurrent()) <= EndHour) {
for (g_pos_352 = 1; g_pos_352 <= 10; g_pos_352++)
if (OrderSend(Symbol(), OP_SELL, Lots, NormalizeDouble(Bid, Digits), 2, 0, 0, Comments, MagicNumber, 0, Red) > 0) return (0);
}
}
RefreshRates();
f0_0();
if (g_count_264 + g_count_268 == 1 && g_count_272 + g_count_276 == 0) {
for (int pos_92 = OrdersTotal() – 1; pos_92 >= 0; pos_92–) {
OrderSelect(pos_92, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_SELL && gi_288 < TotalPositions && TimeHour(TimeCurrent()) >= StartHour && TimeHour(TimeCurrent()) <= EndHour) {
for (g_pos_352 = 1; g_pos_352 <= 10; g_pos_352++) {
if (MarketInfo(Symbol(), MODE_LOTSTEP) == 0.01) g_lots_184 = NormalizeDouble(OrderLots() * LotsMultiplier, 2);
else
if (MarketInfo(Symbol(), MODE_LOTSTEP) == 0.05 || MarketInfo(Symbol(), MODE_LOTSTEP) == 0.1) g_lots_184 = NormalizeDouble(OrderLots() * LotsMultiplier, 1);
if (OrderSend(Symbol(), OP_BUYSTOP, g_lots_184, MathMax(NormalizeDouble(OrderOpenPrice() + gi_196 * gd_216, Digits), NormalizeDouble(Ask + MarketInfo(Symbol(), MODE_SPREAD) * gd_216,
Digits)), 2, 0, 0, Comments, MagicNumber, 0, Green) > 0) return (0);
}
}
if (OrderType() == OP_BUY && gi_288 < TotalPositions && TimeHour(TimeCurrent()) >= StartHour && TimeHour(TimeCurrent()) <= EndHour) {
for (g_pos_352 = 1; g_pos_352 <= 10; g_pos_352++) {
if (MarketInfo(Symbol(), MODE_LOTSTEP) == 0.01) g_lots_184 = NormalizeDouble(OrderLots() * LotsMultiplier, 2);
else
if (MarketInfo(Symbol(), MODE_LOTSTEP) == 0.05 || MarketInfo(Symbol(), MODE_LOTSTEP) == 0.1) g_lots_184 = NormalizeDouble(OrderLots() * LotsMultiplier, 1);
if (OrderSend(Symbol(), OP_SELLSTOP, g_lots_184, MathMin(NormalizeDouble(OrderOpenPrice() – gi_196 * gd_216, Digits), NormalizeDouble(Bid – MarketInfo(Symbol(), MODE_SPREAD) * gd_216,
Digits)), 2, 0, 0, Comments, MagicNumber, 0, Red) > 0) return (0);
}
}
}
}
}
f0_0();
if (g_count_264 + g_count_268 >= 1 && g_count_272 + g_count_276 > 0) {
g_order_lots_308 = 0.0;
g_ticket_328 = 0;
gs_332 = “TYPE”;
for (g_pos_352 = 0; g_pos_352 <= OrdersTotal() – 1; g_pos_352++) {
OrderSelect(g_pos_352, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_BUY || OrderType() == OP_SELL) {
if (OrderLots() > g_order_lots_308) {
g_order_lots_308 = OrderLots();
g_ticket_328 = OrderTicket();
if (OrderType() == OP_BUY) gs_340 = “BUY”;
if (OrderType() == OP_SELL) gs_340 = “SELL”;
}
}
}
}
}
f0_0();
if (g_count_264 + g_count_268 >= 2 && g_count_272 + g_count_276 == 0) {
g_order_lots_300 = 0.0;
g_order_open_price_316 = 0.0;
g_ticket_324 = 0;
gs_332 = “TYPE”;
for (g_pos_352 = 0; g_pos_352 <= OrdersTotal() – 1; g_pos_352++) {
OrderSelect(g_pos_352, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_BUY || OrderType() == OP_SELL) {
if (OrderLots() > g_order_lots_300) {
g_order_lots_300 = OrderLots();
g_order_open_price_316 = OrderOpenPrice();
g_ticket_324 = OrderTicket();
g_datetime_240 = OrderOpenTime();
if (OrderType() == OP_BUY) gs_332 = “BUY”;
if (OrderType() == OP_SELL) gs_332 = “SELL”;
}
}
}
}
if (gs_340 == “BUY” && AutoDilute == TRUE) {
for (g_pos_352 = 1; g_pos_352 <= 10; g_pos_352++)
if (OrderClose(g_ticket_328, g_order_lots_308 / 2.0, Bid, 2, CLR_NONE) == 1) return (0);
}
if (gs_340 == “SELL” && AutoDilute == TRUE) {
for (g_pos_352 = 1; g_pos_352 <= 10; g_pos_352++)
if (OrderClose(g_ticket_328, g_order_lots_308 / 2.0, Ask, 2, CLR_NONE) == 1) return (0);
}
if (gs_332 == “BUY” && gi_288 < TotalPositions && TimeHour(TimeCurrent()) >= StartHour && TimeHour(TimeCurrent()) <= EndHour) {
for (g_pos_352 = 1; g_pos_352 <= 10; g_pos_352++) {
if (MarketInfo(Symbol(), MODE_LOTSTEP) == 0.01) g_lots_184 = NormalizeDouble(g_order_lots_300 * LotsMultiplier, 2);
else
if (MarketInfo(Symbol(), MODE_LOTSTEP) == 0.05 || MarketInfo(Symbol(), MODE_LOTSTEP) == 0.1) g_lots_184 = NormalizeDouble(g_order_lots_300 * LotsMultiplier, 1);
if (OrderSend(Symbol(), OP_SELLSTOP, g_lots_184, MathMin(NormalizeDouble(g_order_open_price_316 – gi_196 * gd_216, Digits), NormalizeDouble(Bid – MarketInfo(Symbol(),
MODE_SPREAD) * gd_216, Digits)), 2, 0, 0, Comments, MagicNumber, 0, Red) > 0) return (0);
}
}
if (gs_332 == “SELL” && gi_288 < TotalPositions && TimeHour(TimeCurrent()) >= StartHour && TimeHour(TimeCurrent()) <= EndHour) {
for (g_pos_352 = 1; g_pos_352 <= 10; g_pos_352++) {
if (MarketInfo(Symbol(), MODE_LOTSTEP) == 0.01) g_lots_184 = NormalizeDouble(g_order_lots_300 * LotsMultiplier, 2);
else
if (MarketInfo(Symbol(), MODE_LOTSTEP) == 0.05 || MarketInfo(Symbol(), MODE_LOTSTEP) == 0.1) g_lots_184 = NormalizeDouble(g_order_lots_300 * LotsMultiplier, 1);
if (OrderSend(Symbol(), OP_BUYSTOP, g_lots_184, MathMax(NormalizeDouble(g_order_open_price_316 + gi_196 * gd_216, Digits), NormalizeDouble(Ask + MarketInfo(Symbol(),
MODE_SPREAD) * gd_216, Digits)), 2, 0, 0, Comments, MagicNumber, 0, Green) > 0) return (0);
}
}
}
RefreshRates();
f0_0();
gd_292 = 0.0;
for (int pos_96 = OrdersTotal() – 1; pos_96 >= 0; pos_96–) {
OrderSelect(pos_96, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) gd_292 += OrderProfit();
}
if (gd_292 >= gi_192) gi_200 = TRUE;
if (gi_200 == TRUE) {
for (int pos_100 = OrdersTotal() – 1; pos_100 >= 0; pos_100–) {
OrderSelect(pos_100, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_SELL) {
for (g_pos_352 = 1; g_pos_352 <= 10; g_pos_352++)
if (OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Ask, Digits), 2, CLR_NONE) == 1) break;
}
if (OrderType() == OP_BUY) {
for (g_pos_352 = 1; g_pos_352 <= 10; g_pos_352++)
if (OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Bid, Digits), 2, CLR_NONE) == 1) break;
}
g_datetime_236 = TimeCurrent();
}
}
gi_unused_256 = 0;
gi_unused_252 = 0;
gi_unused_260 = 1;
}
f0_0();
if (g_count_264 + g_count_268 == 0 && g_count_272 + g_count_276 > 0) {
for (g_pos_352 = 0; g_pos_352 <= OrdersTotal() – 1; g_pos_352++) {
OrderSelect(g_pos_352, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_BUYSTOP || OrderType() == OP_SELLSTOP) {
for (g_pos_352 = 1; g_pos_352 <= 10; g_pos_352++)
if (OrderDelete(OrderTicket()) == 1) break;
}
}
}
}
f0_0();
gi_192 = Profit * MathPow(ProfitMultiplier, g_count_264 + g_count_268 – 1);
gi_196 = Distance * MathPow(DistanceMultiplier, g_count_264 + g_count_268 – 1);
if (gi_288 == 0) {
gi_200 = FALSE;
g_datetime_348 = TimeCurrent();
gi_192 = Profit;
gi_196 = Distance;
}
string ls_104 = “Aeron-AllPairs-2012-v2”;
ls_104 = ls_104
+ “\nMagicNumber=” + MagicNumber;
ls_104 = ls_104
+ “\nLots=” + Lots;
ls_104 = ls_104
+ “\nLotsMultiplier=” + LotsMultiplier;
ls_104 = ls_104
+ “\nDistance=” + gi_196;
ls_104 = ls_104
+ “\nDistanceMultiplier=” + DistanceMultiplier;
ls_104 = ls_104
+ “\nProfit=” + gi_192;
ls_104 = ls_104
+ “\nProfitMultiplier=” + ProfitMultiplier;
ls_104 = ls_104
+ “\nMaximumLots=” + MaximumLots;
ls_104 = ls_104
+ “\nTotalPositions=” + TotalPositions;
ls_104 = ls_104
+ “\nStartHour=” + StartHour;
ls_104 = ls_104
+ “\nEndHour=” + EndHour;
Comment(ls_104);
return (0);
}void f0_0() {
g_count_264 = 0;
g_count_268 = 0;
g_count_272 = 0;
g_count_276 = 0;
g_count_280 = 0;
g_count_284 = 0;
for (int pos_0 = 0; pos_0 < OrdersTotal(); pos_0++) {
if (OrderSelect(pos_0, SELECT_BY_POS, MODE_TRADES) == FALSE || OrderMagicNumber() != MagicNumber) continue;
if (OrderType() == OP_BUY && OrderSymbol() == Symbol()) g_count_264++;
else
if (OrderType() == OP_SELL && OrderSymbol() == Symbol()) g_count_268++;
if (OrderType() == OP_BUYSTOP && OrderSymbol() == Symbol()) g_count_272++;
else
if (OrderType() == OP_SELLSTOP && OrderSymbol() == Symbol()) g_count_276++;
if (OrderType() == OP_BUYLIMIT && OrderSymbol() == Symbol()) g_count_280++;
else
if (OrderType() == OP_SELLLIMIT && OrderSymbol() == Symbol()) g_count_284++;
}
gi_288 = g_count_264 + g_count_268 + g_count_272 + g_count_276;
}
暂无评论...