标签:
杂谈 |
查看原文:http://www.125808047.com/?p=1874
外汇智能交易系统超级刷单王EA,设计独特,商业版EA,网上不少汉化破解版,好像未发现完美破解版。这次抽时间将源码进行整理汉化,交易策略没有任何改变,爱好的可以多研究下。
本网收集整理智能交易EA仅为MQL4编程爱好者提供语法及相关编程技巧的学习研究之用,智能交易存在极高的风险测试请用模拟盘,请勿用于实盘。超级刷单王EA源码如下:
//+------------------------------------------------------------------+
//| 超级刷单王.mq4 |
//| Copyright 2016, QQ:125808047 |
//+------------------------------------------------------------------+
#property copyright "www.125808047.com"
#property link "http://www.125808047.com/"
extern string HeadLine = " www.125808047.com";
double gd_92 = 1.0;
extern int Profit = 35;
extern int gi_104 = 13;
double gd_108 = 1.0;
extern int gi_116 = 13;
extern int range = 10;
extern int Prosadka = 700;
extern int Povtor = 1;
int g_timeframe_140 = PERIOD_M1;
int g_timeframe_144 = PERIOD_M1;
bool gi_148 = FALSE;
int g_timeframe_152 = PERIOD_M15;
bool gi_156 = FALSE;
extern bool Extremal = TRUE;
extern bool Lentyaj = FALSE;
extern double LotSize = 0.01;
extern double LotExponent = 1.8;
extern int LotStep = 15000;
extern bool InformationOnChart = TRUE;
extern int MagicNumber = 123456789;
int g_datetime_228 = 0;
int g_datetime_232 = 0;
int gi_236 = 0;
int g_ticket_240;
int gi_244;
bool gi_248;
bool gi_252;
double g_lots_256;
double g_lots_264;
double g_lots_272;
double g_lots_280;
string g_comment_288;
string gs_296;
int init() {
gi_236 = LotDecimal();
if (Extremal) gi_156 = FALSE;
if (Extremal) gs_296 = "sjbwy";
if (Lentyaj) gs_296 = "lqbz";
if (Extremal == Lentyaj) gs_296 = "mayisi";
return (0);
}
int deinit() {
return (0);
}
int start() {
if (gi_236 == 0) gi_236 = LotDecimal();
Information();
if (Extremal != Lentyaj) {
gi_248 = TRUE;
gi_252 = TRUE;
}
if (g_datetime_228 != iTime(NULL, g_timeframe_140, 0)) {
g_ticket_240 = 0;
gi_244 = CountTrades("buy");
if (gi_244 == 0 && gi_248 == TRUE) {
g_comment_288 = "Martini " + Symbol() + " - Buy " + ((gi_244 + 1));
g_lots_272 = NewLot("buy");
while (g_ticket_240 < 1) {
g_ticket_240 = OrderSend(Symbol(), OP_BUY, g_lots_272, Ask, 3, 0, 0, g_comment_288, MagicNumber, 0, Blue);
if (g_ticket_240 < 1) {
Sleep(1000 * (60 * Povtor));
} else Rrrect("buy");
RefreshRates();
}
}
gi_244 = CountTrades("sell");
if (gi_244 == 0 && gi_252 == TRUE) {
g_comment_288 = "Martini " + Symbol() + " - Sell " + ((gi_244 + 1));
g_lots_280 = NewLot("sell");
while (g_ticket_240 < 1) {
g_ticket_240 = OrderSend(Symbol(), OP_SELL, g_lots_280, Bid, 3, 0, 0, g_comment_288, MagicNumber, 0, Red);
if (g_ticket_240 < 1) { Sleep(1000 * (60 * Povtor)); } else Rrrect("sell"); RefreshRates(); } } g_datetime_228 = iTime(NULL, g_timeframe_140, 0); } if (g_datetime_232 != iTime(NULL, g_timeframe_144, 0)) { g_ticket_240 = 0; gi_244 = CountTrades("buy"); if (gi_244 > 0 && NextOrder("buy")) {
g_comment_288 = "Martini " + Symbol() + " - Buy " + ((gi_244 + 1));
g_lots_256 = NextLot("buy");
while (g_ticket_240 < 1) {
g_ticket_240 = OrderSend(Symbol(), OP_BUY, g_lots_256, Ask, 3, 0, 0, g_comment_288, MagicNumber, 0, Blue);
if (g_ticket_240 < 1) { Sleep(1000 * (60 * Povtor)); } else Rrrect("buy"); RefreshRates(); } } gi_244 = CountTrades("sell"); if (gi_244 > 0 && NextOrder("sell")) {
g_comment_288 = "Martini " + Symbol() + " - Sell " + ((gi_244 + 1));
g_lots_264 = NextLot("sell");
while (g_ticket_240 < 1) {
g_ticket_240 = OrderSend(Symbol(), OP_SELL, g_lots_264, Bid, 3, 0, 0, g_comment_288, MagicNumber, 0, Red);
if (g_ticket_240 < 1) { Sleep(1000 * (60 * Povtor)); } else Rrrect("sell"); RefreshRates(); } } g_datetime_232 = iTime(NULL, g_timeframe_144, 0); } return (0); } void Rrrect(string as_0) { double l_price_8; double l_price_16 = AveragePrice(as_0); for (int l_pos_24 = OrdersTotal() - 1; l_pos_24 >= 0; l_pos_24--) {
bool cg = OrderSelect(l_pos_24, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (as_0 == "buy") {
if (OrderType() == OP_BUY) {
l_price_8 = l_price_16 + Profit * Point;
if (OrderTakeProfit() != l_price_8) {
cg = OrderModify(OrderTicket(), l_price_16, OrderStopLoss(), l_price_8, 0, Yellow);
}
}
}
if (as_0 == "sell") {
if (OrderType() == OP_SELL) {
l_price_8 = l_price_16 - Profit * Point;
if (OrderTakeProfit() != l_price_8) {
cg = OrderModify(OrderTicket(), l_price_16, OrderStopLoss(), l_price_8, 0, Yellow);
}
}
}
}
}
}
double NewLot(string as_0) {
double ld_ret_8;
double l_minlot_16 = MarketInfo(Symbol(), MODE_MINLOT);
if (as_0 == "buy") {
if (gi_156) ld_ret_8 = LotSize;
else ld_ret_8 = NormalizeDouble(LotSize * NormalizeDouble(AccountBalance() / LotStep, 0), gi_236);
}
if (as_0 == "sell") {
if (gi_156) ld_ret_8 = LotSize;
else ld_ret_8 = NormalizeDouble(LotSize * NormalizeDouble(AccountBalance() / LotStep, 0), gi_236);
}
if (ld_ret_8 < l_minlot_16) ld_ret_8 = l_minlot_16;
return (ld_ret_8);
}
double NextLot(string as_0) {
double ld_ret_8;
if (Lentyaj) LotExponent = LotExponent();
if (as_0 == "buy") ld_ret_8 = NormalizeDouble(FindLastOrder(as_0, "Lots") * LotExponent, gi_236);
if (as_0 == "sell") ld_ret_8 = NormalizeDouble(FindLastOrder(as_0, "Lots") * LotExponent, gi_236);
return (ld_ret_8);
}
double LotExponent() {
double ld_0 = 0;
double ld_ret_8 = 1;
while (ld_0 < AccountBalance()) {
ld_ret_8 = (100.0 * ld_ret_8 + 1.0) / 100.0;
ld_0 = 0;
for (int li_16 = 0; li_16 <= 5; li_16++) ld_0 += 10.0 * (LotSize * MathPow(ld_ret_8, li_16) * (Prosadka - range * li_16));
for (li_16 = 6; li_16 <= 9; li_16++) ld_0 += 10.0 * (LotSize * MathPow(ld_ret_8, li_16) * (Prosadka - Prosadka / 10));
for (li_16 = 10; li_16 <= 11; li_16++) ld_0 += 10.0 * (LotSize * MathPow(ld_ret_8, li_16) * (Prosadka - Prosadka / 6)); ld_0 += 10.0 * (LotSize * MathPow(ld_ret_8, 12) * (Prosadka - Prosadka / 4)); } return (ld_ret_8); } int NextOrder(string as_0) { int li_8; bool li_ret_12 = FALSE; double l_iclose_16 = iClose(Symbol(), g_timeframe_152, 1); double l_iopen_24 = iOpen(Symbol(), g_timeframe_152, 1); if (as_0 == "buy") { li_8 = NormalizeDouble(range * MathPow(gd_92, CountTrades(as_0)), 0); if (CountTrades(as_0) == 7) li_8 = Prosadka / 10; if (CountTrades(as_0) == 8) li_8 = Prosadka / 10; if (CountTrades(as_0) == 9) li_8 = Prosadka / 10; if (CountTrades(as_0) == 10) li_8 = Prosadka / 10; if (CountTrades(as_0) == 11) li_8 = Prosadka / 6; if (CountTrades(as_0) == 12) li_8 = Prosadka / 6; if (CountTrades(as_0) == 13) li_8 = Prosadka / 4; if (FindLastOrder(as_0, "Price") - Ask >= li_8 * Point && CountTrades(as_0) < gi_104) {
if (gi_148) {
if (l_iopen_24 <= l_iclose_16) li_ret_12 = TRUE; else li_ret_12 = FALSE; } else li_ret_12 = TRUE; } } if (as_0 == "sell") { li_8 = NormalizeDouble(range * MathPow(gd_108, CountTrades(as_0)), 0); if (CountTrades(as_0) == 7) li_8 = Prosadka / 10; if (CountTrades(as_0) == 8) li_8 = Prosadka / 10; if (CountTrades(as_0) == 9) li_8 = Prosadka / 10; if (CountTrades(as_0) == 10) li_8 = Prosadka / 10; if (CountTrades(as_0) == 11) li_8 = Prosadka / 6; if (CountTrades(as_0) == 12) li_8 = Prosadka / 6; if (CountTrades(as_0) == 13) li_8 = Prosadka / 4; if (Bid - FindLastOrder(as_0, "Price") >= li_8 * Point && CountTrades(as_0) < gi_116) { if (gi_148) { if (l_iopen_24 >= l_iclose_16) li_ret_12 = TRUE;
else li_ret_12 = FALSE;
} else li_ret_12 = TRUE;
}
}
return (li_ret_12);
}
double FindLastOrder(string as_0, string as_8) {
double l_ord_open_price_16;
double l_ord_lots_24;
int l_ticket_32 = 0;
for (int l_pos_36 = OrdersTotal() - 1; l_pos_36 >= 0; l_pos_36--) {
bool cg = OrderSelect(l_pos_36, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (as_0 == "buy") {
if (OrderType() == OP_BUY) {
if (OrderTicket() > l_ticket_32) {
l_ord_open_price_16 = OrderOpenPrice();
l_ord_lots_24 = OrderLots();
l_ticket_32 = OrderTicket();
}
}
}
if (as_0 == "sell") {
if (OrderType() == OP_SELL) {
if (OrderTicket() > l_ticket_32) {
l_ord_open_price_16 = OrderOpenPrice();
l_ord_lots_24 = OrderLots();
l_ticket_32 = OrderTicket();
}
}
}
}
}
if (as_8 == "Price") return (l_ord_open_price_16);
if (as_8 == "Lots") return (l_ord_lots_24);
return (0.0);
}
int CountTrades(string as_0) {
int l_count_8 = 0;
for (int l_pos_12 = OrdersTotal() - 1; l_pos_12 >= 0; l_pos_12--) {
bool cg = OrderSelect(l_pos_12, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (as_0 == "buy")
if (OrderType() == OP_BUY) l_count_8++;
if (as_0 == "sell")
if (OrderType() == OP_SELL) l_count_8++;
}
}
return (l_count_8);
}
double AveragePrice(string as_0) {
double ld_8 = 0;
double ld_16 = 0;
for (int l_pos_24 = OrdersTotal() - 1; l_pos_24 >= 0; l_pos_24--) {
bool cg = OrderSelect(l_pos_24, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (as_0 == "buy") {
if (OrderType() == OP_BUY) {
ld_8 += OrderOpenPrice() * OrderLots();
ld_16 += OrderLots();
}
}
if (as_0 == "sell") {
if (OrderType() == OP_SELL) {
ld_8 += OrderOpenPrice() * OrderLots();
ld_16 += OrderLots();
}
}
}
}
ld_8 = NormalizeDouble(ld_8 / ld_16, Digits);
return (ld_8);
}
void Information() {
if (InformationOnChart) {
Comment("" + " www.125808047.com " + "正规平台开户QQ125808047"
+ "\n"
+ " ------------------------------------------------"
+ "\n"
+ " 公司: " + AccountCompany() + ".杠杆 1:" + DoubleToStr(AccountLeverage(), 0)
+ "\n"
+ " ------------------------------------------------"
+ "\n"
+ " 多单订单数" + CountTrades("buy")
+ "\n"
+ " 多单获利 " + DoubleToStr(Balance("buy", "Balance"), 2)
+ "\n"
+ " 多单手数 " + DoubleToStr(Balance("buy", "Lot"), 2)
+ "\n"
+ " ------------------------------------------------"
+ "\n"
+ " 空单订单数" + CountTrades("sell")
+ "\n"
+ " 空单获利 " + DoubleToStr(Balance("sell", "Balance"), 2)
+ "\n"
+ " 空单手数 " + DoubleToStr(Balance("sell", "Lot"), 2)
+ "\n"
+ " ------------------------------------------------"
+ "\n"
+ " 总获利 " + DoubleToStr(Balance("buy", "Balance") + Balance("sell", "Balance"), 2)
+ "\n"
+ " ------------------------------------------------"
+ "\n"
+ " 交易信息"
+ "\n"
+ " ");
}
}
double Balance(string as_0, string as_8) {
double ld_ret_16 = 0;
for (int l_pos_24 = OrdersTotal() - 1; l_pos_24 >= 0; l_pos_24--) {
bool cg = OrderSelect(l_pos_24, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (as_0 == "buy") {
if (OrderType() == OP_BUY) {
if (as_8 == "Balance") ld_ret_16 = ld_ret_16 + OrderProfit() - OrderSwap() - OrderCommission();
if (as_8 == "Lot") ld_ret_16 += OrderLots();
}
}
if (as_0 == "sell") {
if (OrderType() == OP_SELL) {
if (as_8 == "Balance") ld_ret_16 = ld_ret_16 + OrderProfit() - OrderSwap() - OrderCommission();
if (as_8 == "Lot") ld_ret_16 += OrderLots();
}
}
}
}
return (ld_ret_16);
}
double LotDecimal() {
double l_lotstep_0 = MarketInfo(Symbol(), MODE_LOTSTEP);
int li_ret_8 = MathCeil(MathAbs(MathLog(l_lotstep_0) / MathLog(10)));
return (li_ret_8);
}
前一篇:终极动态趋势网格EA
后一篇:MT4指标MTF+MACD

加载中…