2007自动交易锦标赛的获胜者
2007自动交易锦标赛已经过去。大赛的获胜者们已经得到了他们的奖杯和奖金。
第一名被来自乌克兰的 Olexandr Topchylo获得。他的智能交易获得了 130 000 美元(竞赛起始资金10 000 美元),远远领先其它参赛者 。 Olexandr获得由锦标赛主要赞助商ODL Securities Limited 提供的 40 000 美元的奖金。
以下为其参赛的EA-better的MQL4破解源码,供大家参考。如有投诉,将立即删除!
#include extern double lots = 0.1;extern int Slippage = 2;extern int Warp = 67;extern double Deviation = 1.85;extern int Amplitude = 155;extern double Distortion = 0.79;extern bool SL_long_EQUAL_SL_short = FALSE;extern double SL_long = 80.0;extern double SL_short = 65.0;extern bool UseSound = TRUE;extern int MagicNumber = 55555;string gs_140 = "PNN Shell ?2008, FX-Systems Co Ltd";int g_time_148 = 0;int gi_152 = 6;double gd_156 = 5.0;double gd_164 = 25.0;void init() { if (SL_long_EQUAL_SL_short == TRUE) SL_short = SL_long;}void deinit() {}void start() { int l_spread_0; int li_4; int l_ord_total_8; int l_ticket_16; ExternalParametersCheck(); CheckConditions(); if (Time[0] != g_time_148) { g_time_148 = Time[0]; l_spread_0 = 3; if (IsTradeAllowed()) { RefreshRates(); l_spread_0 = MarketInfo(Symbol(), MODE_SPREAD); } else { g_time_148 = Time[1]; return; } li_4 = -1; l_ord_total_8 = OrdersTotal(); for (int l_pos_12 = l_ord_total_8 - 1; l_pos_12 >= 0; l_pos_12--) { OrderSelect(l_pos_12, SELECT_BY_POS, MODE_TRADES); if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) { l_ticket_16 = OrderTicket(); if (OrderType() == OP_BUY) { if (Bid = OrderStopLoss() - (2.0 * SL_short + l_spread_0) * Point) return; if (Direction(Warp, Deviation, Amplitude, Distortion) > 0.0) { li_4 = OrderSendReliable(Symbol(), OP_BUY, lots, Ask, Slippage, Bid - SL_long * Point, 0, gs_140, MagicNumber, 0, Blue); Sleep(30000); if (li_4 0.0) { li_4 = OrderSendReliable(Symbol(), OP_BUY, lots, Ask, Slippage, Bid - SL_long * Point, 0, gs_140, MagicNumber, 0, Blue); if (li_4 10) { Comment("... 青溧眍 耠桫觐?恹耦觐?珥圜屙桢 镳铖赅朦琨忄龛 Slippage,", "\n", "... 殃铕疱牝桊箝蝈 黩钺?猁腩 礤 犷脲?10??镥疱玎矬耱栩?耧屦?"); return; } if (Warp > 100 || Warp 2.0 || Warp 200 || Amplitude 1.0 || Distortion 0) { a_price_20 = NormalizeDouble(a_price_20, l_digits_72); a_price_32 = NormalizeDouble(a_price_32, l_digits_72); a_price_40 = NormalizeDouble(a_price_40, l_digits_72); } if (a_price_32 != 0.0) OrderReliable_EnsureValidStop(a_symbol_0, a_price_20, a_price_32); int l_error_76 = GetLastError(); l_error_76 = 0; bool li_80 = FALSE; bool li_84 = FALSE; int l_ticket_88 = -1; if (a_cmd_8 == OP_BUYSTOP || a_cmd_8 == OP_SELLSTOP) { l_count_68 = 0; while (!li_80) { if (IsTradeAllowed()) { l_ticket_88 = OrderSend(a_symbol_0, a_cmd_8, a_lots_12, a_price_20, a_slippage_28, a_price_32, a_price_40, a_comment_48, a_magic_56, a_datetime_60, a_color_64); l_error_76 = GetLastError(); } else l_count_68++; switch (l_error_76) { case 0/* NO_ERROR */: li_80 = TRUE; break; case 4/* SERVER_BUSY */: case 6/* NO_CONNECTION */: case 129/* INVALID_PRICE */: case 136/* OFF_QUOTES */: case 137/* BROKER_BUSY */: case 146/* TRADE_CONTEXT_BUSY */: l_count_68++; break; case 135/* PRICE_CHANGED */: case 138/* REQUOTE */: RefreshRates(); continue; break; case 130/* INVALID_STOPS */: ld_96 = MarketInfo(a_symbol_0, MODE_STOPLEVEL) * MarketInfo(a_symbol_0, MODE_POINT); if (a_cmd_8 == OP_BUYSTOP) { if (MathAbs(Ask - a_price_20) gi_152) li_80 = TRUE; if (li_80) { if (l_error_76 != 0/* NO_ERROR */) Print("OrderSendReliable: non-retryable error: " + ErrorDescription(l_error_76)); if (l_count_68 > gi_152) Print("OrderSendReliable: retry attempts maxed at " + gi_152); } if (!li_80) { Print("OrderSendReliable: retryable error (" + l_count_68 + "/" + gi_152 + "): " + ErrorDescription(l_error_76)); OrderReliable_SleepRandomTime(gd_156, gd_164); RefreshRates(); } } if (l_error_76 == 0/* NO_ERROR */) { Print("OrderSendReliable: apparently successful OP_BUYSTOP or OP_SELLSTOP order placed, details follow."); OrderSelect(l_ticket_88, SELECT_BY_TICKET, MODE_TRADES); OrderPrint(); return (l_ticket_88); } if (!li_84) { Print("OrderSendReliable: failed to execute OP_BUYSTOP/OP_SELLSTOP, after " + l_count_68 + " retries"); Print("OrderSendReliable: failed trade: " + OrderReliable_CommandString(a_cmd_8) + " " + a_symbol_0 + "@" + a_price_20 + " tp@" + a_price_40 + " sl@" + a_price_32); Print("OrderSendReliable: last error: " + ErrorDescription(l_error_76)); return (-1); } } if (li_84) { Print("OrderSendReliable: going from limit order to market order because market is too close."); if (a_cmd_8 == OP_BUYSTOP) { a_cmd_8 = 0; a_price_20 = Ask; } else { if (a_cmd_8 == OP_SELLSTOP) { a_cmd_8 = 1; a_price_20 = Bid; } } } l_error_76 = GetLastError(); l_error_76 = 0; l_ticket_88 = -1; if (a_cmd_8 == OP_BUY || a_cmd_8 == OP_SELL) { l_count_68 = 0; while (!li_80) { if (IsTradeAllowed()) { l_ticket_88 = OrderSend(a_symbol_0, a_cmd_8, a_lots_12, a_price_20, a_slippage_28, a_price_32, a_price_40, a_comment_48, a_magic_56, a_datetime_60, a_color_64); l_error_76 = GetLastError(); } else l_count_68++; switch (l_error_76) { case 0/* NO_ERROR */: li_80 = TRUE; break; case 4/* SERVER_BUSY */: case 6/* NO_CONNECTION */: case 129/* INVALID_PRICE */: case 136/* OFF_QUOTES */: case 137/* BROKER_BUSY */: case 146/* TRADE_CONTEXT_BUSY */: l_count_68++; break; case 135/* PRICE_CHANGED */: case 138/* REQUOTE */: RefreshRates(); continue; break; default: li_80 = TRUE; } if (l_count_68 > gi_152) li_80 = TRUE; if (!li_80) { Print("OrderSendReliable: retryable error (" + l_count_68 + "/" + gi_152 + "): " + ErrorDescription(l_error_76)); OrderReliable_SleepRandomTime(gd_156, gd_164); RefreshRates(); } if (li_80) { if (l_error_76 != 0/* NO_ERROR */) Print("OrderSendReliable: non-retryable error: " + ErrorDescription(l_error_76)); if (l_count_68 > gi_152) Print("OrderSendReliable: retry attempts maxed at " + gi_152); } } if (l_error_76 == 0/* NO_ERROR */) { Print("OrderSendReliable: apparently successful OP_BUY or OP_SELL order placed, details follow."); OrderSelect(l_ticket_88, SELECT_BY_TICKET, MODE_TRADES); OrderPrint(); return (l_ticket_88); } Print("OrderSendReliable: failed to execute OP_BUY/OP_SELL, after " + l_count_68 + " retries"); Print("OrderSendReliable: failed trade: " + OrderReliable_CommandString(a_cmd_8) + " " + a_symbol_0 + "@" + a_price_20 + " tp@" + a_price_40 + " sl@" + a_price_32); Print("OrderSendReliable: last error: " + ErrorDescription(l_error_76)); return (-1); } return (0);}bool OrderModifyReliable(int a_ticket_0, double a_price_4, double a_price_12, double a_price_20, int a_datetime_28, color a_color_32 = -1) { string ls_40; if (!IsConnected()) { Print("OrderModifyReliable: error: IsConnected() == false"); return (-1); } if (IsStopped()) { Print("OrderModifyReliable: error: IsStopped() == true"); return (-1); } for (int l_count_36 = 0; !IsTradeAllowed() && l_count_36 gi_152) li_56 = TRUE; if (!li_56) { Print("OrderModifyReliable: retryable error (" + l_count_36 + "/" + gi_152 + "): " + ErrorDescription(l_error_52)); OrderReliable_SleepRandomTime(gd_156, gd_164); RefreshRates(); } if (li_56) { if (l_error_52 != 0/* NO_ERROR */ && l_error_52 != 1/* NO_RESULT */) Print("OrderModifyReliable: non-retryable error: " + ErrorDescription(l_error_52)); if (l_count_36 > gi_152) Print("OrderModifyReliable: retry attempts maxed at " + gi_152); } } if (l_error_52 == 0/* NO_ERROR */) { Print("OrderModifyReliable: apparently successful modification order, updated trade details follow."); OrderSelect(a_ticket_0, SELECT_BY_TICKET, MODE_TRADES); OrderPrint(); return (TRUE); } if (l_error_52 == 1/* NO_RESULT */) { Print("OrderModifyReliable: Server reported modify order did not actually change parameters."); Print("OrderModifyReliable: redundant modification: " + a_ticket_0 + " " + ls_40 + "@" + a_price_4 + " tp@" + a_price_20 + " sl@" + a_price_12); Print("OrderModifyReliable: Suggest modifying code logic"); } Print("OrderModifyReliable: failed to execute modify after " + l_count_36 + " retries"); Print("OrderModifyReliable: failed modification: " + a_ticket_0 + " " + ls_40 + "@" + a_price_4 + " tp@" + a_price_20 + " sl@" + a_price_12); Print("OrderModifyReliable: last error: " + ErrorDescription(l_error_52)); return (FALSE);}void OrderReliable_EnsureValidStop(string a_symbol_0, double ad_8, double &ad_16) { double ld_24; if (ad_16 != 0.0) { ld_24 = MarketInfo(a_symbol_0, MODE_STOPLEVEL) * MarketInfo(a_symbol_0, MODE_POINT); if (MathAbs(ad_8 - ad_16) ad_16) ad_16 = ad_8 - ld_24; else { if (ad_8 0.0) { li_24 = MathRound(ad_8 / 0.1); ld_28 = 1.0 - 1.0 / ld_16; Sleep(1000); for (int l_count_36 = 0; l_count_36 32768.0 * ld_28) break; Sleep(1000); } } }} |