论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
帖子
作者
回复/查看
最后发表
2017-09-12 07:18
3281
45798
2022-11-02 02:46
2017-05-19 07:31
3326
48644
2022-10-23 13:51
2017-05-23 14:06
2017-03-16 14:20
724
36602
2023-11-15 12:33
2017-03-20 07:07
2017-02-12 12:22
162
35852
2021-08-29 11:43
2016-07-06 09:26
34
1726
2016-07-07 08:32
张翠山大侠,麻烦将下面的EA程序给改一下,主要是其中有两句SWITCH的,有问题,非常谢谢 #property copyright "Copyright QQ:9695905" #property link "www.eafan.net" extern double Lots = 0.1; extern int TakeProfit = 30; extern int StopLoss = 0; extern bool ConstantStop = FALSE; extern int Step1 = 30; extern int TP1 = 30; extern int Step2 = 30; extern int TP2 = 30; extern int Step3 = 30; extern int TP3 = 30; extern int Step4 = 30; extern int TP4 = 30; extern int Step5 = 30; extern int TP5 = 30; extern int Step6 = 30; extern int TP6 = 30; extern int Step7 = 30; extern int TP7 = 30; extern int Step8 = 30; extern int TP8 = 30; extern int Step9 = 30; extern int TP9 = 30; extern int Step10 = 30; extern int TP10 = 30; extern int Slippage = 3; int gi_180 = 2; extern int StartHour = 0; extern int EndHour = 24; extern int Magic = 111; extern bool CloseAllNow = FALSE; extern bool UseMACD = FALSE; extern int BrokerMode = 1; extern bool MM_advisor = FALSE; extern int FridayCloseTime = 10; int gi_216 = D'01.01.2008 08:00'; int gi_220 = D'08.12.2016 08:00'; string gs_224 = "FXPROMAKER is expired. Visit www.fxpromaker.com"; int init() { // if (!IsDemo()) { // Comment("Invalid Account. Please contact EA Provider"); // return (-1); // } return (1); } int start() { int li_28; int li_32; int l_ticket_36; double l_price_72; double l_price_80; double l_price_88; double l_lots_96; double l_pips_160; double l_pips_168; double l_price_208; double l_price_216; double l_price_224; bool l_bool_320; // if (!IsDemo()) return (-1); if (CloseAllNow == TRUE) { for (int l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) { OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES); if (OrderSymbol() == Symbol() || BrokerMode == 3 && OrderMagicNumber() == Magic) { if (OrderType() == OP_BUY || OrderType() == OP_SELL) OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 5, CLR_NONE); if (OrderType() != OP_BUY && OrderType() != OP_SELL) OrderDelete(OrderTicket()); } } return (0); } int l_ticket_4 = 0; int l_ticket_8 = 0; int l_ticket_12 = 0; int l_ticket_16 = 0; int l_ticket_20 = 0; int l_ticket_24 = 0; double ld_40 = 0; double ld_48 = 0; double l_ord_open_price_56 = 0; double l_ord_open_price_64 = 0; double l_ord_takeprofit_104 = 0; double l_ord_takeprofit_112 = 0; double l_ord_lots_120 = 0; double l_ord_lots_128 = 0; double l_ord_lots_136 = 0; double l_ord_lots_144 = 0; double ld_176 = 0; double ld_184 = 0; double l_ord_lots_192 = 0; double l_ord_lots_200 = 0; string ls_232 = ""; string ls_240 = ""; string ls_248 = ""; string ls_256 = ""; string ls_264 = ""; string ls_272 = ""; string ls_280 = ""; string ls_288 = ""; string ls_296 = ""; string ls_304 = ""; string ls_312 = ""; if (MM_advisor == TRUE) li_32 = 100; else li_32 = 1; if (iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 0) > iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 1)) li_28 = 2; if (iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 0) < iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 1)) li_28 = 1; for (int l_pos_324 = 0; l_pos_324 < OrdersTotal(); l_pos_324++) { OrderSelect(l_pos_324, SELECT_BY_POS, MODE_TRADES); if (OrderSymbol() == Symbol() || BrokerMode == 3 && OrderMagicNumber() == Magic) { if (OrderType() == OP_BUY && OrderLots() > ld_40) { ld_40 = OrderLots(); l_ord_open_price_56 = OrderOpenPrice(); l_ticket_4 = OrderTicket(); l_ord_takeprofit_112 = OrderTakeProfit(); } if (OrderType() == OP_BUY) { if (OrderLots() < l_ord_lots_192 || l_ord_lots_192 == 0.0) { l_ord_lots_192 = OrderLots(); ld_176 = OrderOpenPrice() - StopLoss * Point; } } if (OrderType() == OP_SELL && OrderLots() > ld_48) { ld_48 = OrderLots(); l_ord_open_price_64 = OrderOpenPrice(); l_ticket_8 = OrderTicket(); l_ord_takeprofit_104 = OrderTakeProfit(); } if (OrderType() == OP_SELL) { if (OrderLots() < l_ord_lots_200 || l_ord_lots_200 == 0.0) { l_ord_lots_200 = OrderLots(); ld_184 = OrderOpenPrice() + StopLoss * Point; } } if (OrderType() == OP_BUYLIMIT) { l_ticket_12 = OrderTicket(); l_ord_lots_136 = OrderLots(); } if (OrderType() == OP_SELLLIMIT) { l_ticket_16 = OrderTicket(); l_ord_lots_144 = OrderLots(); } if (OrderType() == OP_BUYSTOP) { l_ticket_20 = OrderTicket(); l_ord_lots_120 = OrderLots(); } if (OrderType() == OP_SELLSTOP) { l_ticket_24 = OrderTicket(); l_ord_lots_128 = OrderLots(); } } } if (l_ticket_4 == 0 && l_ticket_12 != 0) OrderDelete(l_ticket_12); if (l_ticket_4 == 0 && l_ticket_12 == 0) { if (TimeCurrent() >= gi_216 && TimeCurrent() <= gi_220) { l_price_80 = Ask - StopLoss * Point; if (StopLoss <= 0) l_price_80 = 0; l_price_88 = Ask + TakeProfit * Point; if ((StartHour < EndHour && TimeHour(TimeCurrent()) >= StartHour && TimeHour(TimeCurrent()) < EndHour) || (StartHour > EndHour && TimeHour(TimeCurrent()) >= StartHour || TimeHour(TimeCurrent()) < EndHour)) { if (DayOfWeek() != 5 || Hour() < FridayCloseTime) { if ((li_28 == 2 && l_ticket_8 == 0) || UseMACD == FALSE) { if (AccountFreeMarginCheck(Symbol(), OP_BUY, Lots * li_32) >= 0.0) { if (BrokerMode != 2 && BrokerMode != 3) OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, l_price_80, l_price_88, "Magic = " + Magic, Magic, 0, CLR_NONE); else { l_ticket_36 = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, 0, 0, "Magic = " + Magic, Magic, 0, CLR_NONE); if (l_ticket_36 > 0) { l_bool_320 = OrderModify(l_ticket_36, OrderOpenPrice(), l_price_80, l_price_88, 0, CLR_NONE); if (l_bool_320 == FALSE) Print("Error modifying BUY order : ", GetLastError()); } } } else { if (AccountFreeMarginCheck(Symbol(), OP_BUY, Lots) >= 0.0) ls_296 = "we recommend you to decrease your start lot or increase deposit"; else ls_248 = "BUY, " + DoubleToStr(Lots, 2) + " lots. "; } } } } } else ls_240 = gs_224; } if (l_ticket_8 == 0 && l_ticket_16 != 0) OrderDelete(l_ticket_16); if (l_ticket_8 == 0 && l_ticket_16 == 0) { if (TimeCurrent() >= gi_216 && TimeCurrent() <= gi_220) { l_price_80 = Bid + StopLoss * Point; if (StopLoss <= 0) l_price_80 = 0; l_price_88 = Bid - TakeProfit * Point; if ((StartHour < EndHour && TimeHour(TimeCurrent()) >= StartHour && TimeHour(TimeCurrent()) < EndHour) || (StartHour > EndHour && TimeHour(TimeCurrent()) >= StartHour || TimeHour(TimeCurrent()) < EndHour)) { if (DayOfWeek() != 5 || Hour() < FridayCloseTime) { if ((li_28 == 1 && l_ticket_4 == 0) || UseMACD == FALSE) { if (AccountFreeMarginCheck(Symbol(), OP_SELL, Lots * li_32) >= 0.0) { if (BrokerMode != 2 && BrokerMode != 3) OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, l_price_80, l_price_88, "Magic = " + Magic, Magic, 0, CLR_NONE); else { l_ticket_36 = OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, 0, 0, "Magic = " + Magic, Magic, 0, CLR_NONE); if (l_ticket_36 > 0) { l_bool_320 = OrderModify(l_ticket_36, OrderOpenPrice(), l_price_80, l_price_88, 0, CLR_NONE); if (l_bool_320 == FALSE) Print("Error modifying SELL order : ", GetLastError()); } } } else { if (AccountFreeMarginCheck(Symbol(), OP_SELL, Lots) >= 0.0) ls_296 = "we recommend you to decrease your start lot or increase deposit"; else ls_256 = "SELL, " + DoubleToStr(Lots, 2) + " lots. "; } } } } } else ls_240 = gs_224; } if (l_ticket_4 != 0 && l_ticket_12 != 0) { if (AccountFreeMarginCheck(Symbol(), OP_BUY, l_ord_lots_136) < 0.0) { ls_280 = "BUYLIMIT, " + DoubleToStr(l_ord_lots_136, 2) + " lots. "; OrderDelete(l_ticket_12); } } if (l_ticket_4 != 0 && l_ticket_12 == 0) { if (AccountFreeMarginCheck(Symbol(), OP_BUY, 2.0 * ld_40) >= 0.0) { l_pips_168 = FinalStep(NormalizeDouble(ld_40 / l_ord_lots_192, 0)); l_pips_160 = FinalTP(NormalizeDouble(ld_40 / l_ord_lots_192, 0)); l_price_72 = l_ord_open_price_56 - l_pips_168 * Point; if (ConstantStop == FALSE) l_price_80 = l_price_72 - StopLoss * Point; else l_price_80 = ld_176; if (StopLoss <= 0) l_price_80 = 0; l_price_88 = l_price_72 + l_pips_160 * Point; l_lots_96 = NormalizeDouble(2.0 * ld_40, gi_180); l_ticket_12 = OrderSend(Symbol(), OP_BUYLIMIT, l_lots_96, l_price_72, Slippage, l_price_80, l_price_88, "Magic = " + Magic, Magic, 0, CLR_NONE); } else ls_264 = "BUYLIMIT, " + DoubleToStr(2.0 * ld_40, 2) + " lots. "; } if (l_ticket_8 != 0 && l_ticket_16 != 0) { if (AccountFreeMarginCheck(Symbol(), OP_SELL, l_ord_lots_144) < 0.0) { ls_288 = "SELLLIMIT, " + DoubleToStr(l_ord_lots_144, 2) + " lots. "; OrderDelete(l_ticket_16); } } if (l_ticket_8 != 0 && l_ticket_16 == 0) { if (AccountFreeMarginCheck(Symbol(), OP_SELL, 2.0 * ld_48) >= 0.0) { l_pips_168 = FinalStep(NormalizeDouble(ld_48 / l_ord_lots_200, 0)); l_pips_160 = FinalTP(NormalizeDouble(ld_48 / l_ord_lots_200, 0)); l_price_72 = l_ord_open_price_64 + l_pips_168 * Point; if (ConstantStop == FALSE) l_price_80 = l_price_72 + StopLoss * Point; else l_price_80 = ld_184; if (StopLoss <= 0) l_price_80 = 0; l_price_88 = l_price_72 - l_pips_160 * Point; l_lots_96 = NormalizeDouble(2.0 * ld_48, gi_180); l_ticket_16 = OrderSend(Symbol(), OP_SELLLIMIT, l_lots_96, l_price_72, Slippage, l_price_80, l_price_88, "Magic = " + Magic, Magic, 0, CLR_NONE); } else ls_272 = "SELLLIMIT, " + DoubleToStr(2.0 * ld_48, 2) + " lots. "; } if (l_ticket_20 != 0 && l_ord_lots_120 <= ld_40 || l_ord_lots_120 == l_ord_lots_136) OrderDelete(l_ticket_20); if (l_ord_lots_192 != 0.0) l_pips_168 = FinalStep(NormalizeDouble(ld_40 / l_ord_lots_192, 0)); if (l_ticket_4 != 0 && l_ord_open_price_56 - Ask > l_pips_168 * Point && l_ticket_12 <= 0 || l_ticket_20 == 0) { l_price_72 = l_ord_open_price_56 - l_pips_168 * Point; l_price_224 = Ask; while (l_price_72 >= l_price_224) { ld_40 = 2.0 * ld_40; l_pips_168 = FinalStep(NormalizeDouble(ld_40 / l_ord_lots_192, 0)); l_price_72 -= l_pips_168 * Point; if (l_price_72 < l_price_224) { if (l_ticket_12 <= 0) { l_ticket_12 = -2; l_pips_160 = FinalTP(NormalizeDouble(ld_40 / l_ord_lots_192, 0)); if (ConstantStop == FALSE) l_price_80 = l_price_72 - StopLoss * Point; else l_price_80 = ld_176; if (StopLoss <= 0) l_price_80 = 0; l_price_88 = l_price_72 + l_pips_160 * Point; l_lots_96 = NormalizeDouble(2.0 * ld_40, gi_180); if (AccountFreeMarginCheck(Symbol(), OP_BUY, 2.0 * ld_40) >= 0.0) l_ticket_12 = OrderSend(Symbol(), OP_BUYLIMIT, l_lots_96, l_price_72, Slippage, l_price_80, l_price_88, "Magic = " + Magic, Magic, 0, CLR_NONE); else ls_304 = "BUYLIMIT, " + DoubleToStr(l_lots_96, 2) + " lots. "; } if (l_ticket_20 == 0 && ld_40 != l_ord_lots_136 && l_ticket_12 != -2) { l_price_208 = l_price_72 + l_pips_168 * Point; l_pips_160 = FinalTP(NormalizeDouble(ld_40 / 2.0 / l_ord_lots_192, 0)); l_price_88 = l_price_208 + l_pips_160 * Point; l_lots_96 = NormalizeDouble(ld_40, gi_180); if (ConstantStop == FALSE) l_price_80 = l_price_208 - StopLoss * Point; else l_price_80 = ld_176; if (StopLoss <= 0) l_price_80 = 0; l_ticket_36 = OrderSend(Symbol(), OP_BUYSTOP, l_lots_96, l_price_208, Slippage, l_price_80, l_price_88, "Magic = " + Magic, Magic, 0, CLR_NONE); } } } } if (l_ticket_24 != 0 && l_ord_lots_128 <= ld_48 || l_ord_lots_128 == l_ord_lots_144) OrderDelete(l_ticket_24); if (l_ord_lots_200 != 0.0) l_pips_168 = FinalStep(NormalizeDouble(ld_48 / l_ord_lots_200, 0)); if (l_ticket_8 != 0 && Bid - l_ord_open_price_64 > l_pips_168 * Point && l_ticket_16 <= 0 || l_ticket_24 == 0) { l_price_72 = l_ord_open_price_64 + l_pips_168 * Point; l_price_224 = Bid; while (l_price_72 <= l_price_224) { ld_48 = 2.0 * ld_48; l_pips_168 = FinalStep(NormalizeDouble(ld_48 / l_ord_lots_200, 0)); l_price_72 += l_pips_168 * Point; if (l_price_72 > l_price_224) { if (l_ticket_16 <= 0) { l_ticket_16 = -2; l_pips_160 = FinalTP(NormalizeDouble(ld_48 / l_ord_lots_200, 0)); if (ConstantStop == FALSE) l_price_80 = l_price_72 + StopLoss * Point; else l_price_80 = ld_184; if (StopLoss <= 0) l_price_80 = 0; l_price_88 = l_price_72 - l_pips_160 * Point; l_lots_96 = NormalizeDouble(2.0 * ld_48, gi_180); if (AccountFreeMarginCheck(Symbol(), OP_SELL, 2.0 * ld_48) >= 0.0) l_ticket_16 = OrderSend(Symbol(), OP_SELLLIMIT, l_lots_96, l_price_72, Slippage, l_price_80, l_price_88, "Magic = " + Magic, Magic, 0, CLR_NONE); else ls_312 = "SELLLIMIT, " + DoubleToStr(l_lots_96, 2) + " lots. "; } if (l_ticket_24 == 0 && ld_48 != l_ord_lots_144 && l_ticket_16 != -2) { l_price_216 = l_price_72 - l_pips_168 * Point; l_pips_160 = FinalTP(NormalizeDouble(ld_48 / 2.0 / l_ord_lots_200, 0)); l_price_88 = l_price_216 - l_pips_160 * Point; l_lots_96 = NormalizeDouble(ld_48, gi_180); if (ConstantStop == FALSE) l_price_80 = l_price_216 + StopLoss * Point; else l_price_80 = ld_184; if (StopLoss <= 0) l_price_80 = 0; l_ticket_36 = OrderSend(Symbol(), OP_SELLSTOP, l_lots_96, l_price_216, Slippage, l_price_80, l_price_88, "Magic = " + Magic, Magic, 0, CLR_NONE); } } } } for (l_pos_324 = 0; l_pos_324 < OrdersTotal(); l_pos_324++) { OrderSelect(l_pos_324, SELECT_BY_POS, MODE_TRADES); if (OrderSymbol() == Symbol() || BrokerMode == 3 && OrderType() == OP_BUY && l_ticket_4 != 0 && OrderMagicNumber() == Magic) { if (ConstantStop == FALSE) l_price_80 = l_ord_open_price_56 - StopLoss * Point; else l_price_80 = ld_176; if (StopLoss <= 0) l_price_80 = 0; if (OrderLots() < ld_40) l_price_88 = l_ord_takeprofit_112; else l_price_88 = OrderTakeProfit(); if (l_price_88 != OrderTakeProfit() || l_price_80 != OrderStopLoss()) OrderModify(OrderTicket(), OrderOpenPrice(), l_price_80, l_price_88, 0, CLR_NONE); } if (OrderSymbol() == Symbol() || BrokerMode == 3 && OrderType() == OP_SELL && l_ticket_8 != 0 && OrderMagicNumber() == Magic) { if (ConstantStop == FALSE) l_price_80 = l_ord_open_price_64 + StopLoss * Point; else l_price_80 = ld_184; if (StopLoss <= 0) l_price_80 = 0; if (OrderLots() < ld_48) l_price_88 = l_ord_takeprofit_104; else l_price_88 = OrderTakeProfit(); if (l_price_88 != OrderTakeProfit() || l_price_80 != OrderStopLoss()) OrderModify(OrderTicket(), OrderOpenPrice(), l_price_80, l_price_88, 0, CLR_NONE); } } if (ls_248 != "" || ls_256 != "" || ls_264 != "" || ls_272 != "" || ls_280 != "" || ls_288 != "" || ls_304 != "" || ls_312 != "") ls_232 = "Not enough margin for opening orders: "; Comment(ls_240, "\n", ls_232, ls_248, ls_256, ls_264, ls_272, ls_280, ls_288, ls_304, ls_312, "\n", ls_296); return (0); } int FinalStep(double ad_0) { switch (ad_0) //主要是这句 { case 1: return (Step1); case 2: return (Step2); case 4: return (Step3); case 8: return (Step4); case 16: return (Step5); case 32: return (Step6); case 64: return (Step7); case 128: return (Step8); case 256: return (Step9); case 512: return (Step10); } return (Step10); } int FinalTP(double ad_0) { switch (ad_0) {//主要是这句 case 1: return (TP1); case 2: return (TP2); case 4: return (TP3); case 8: return (TP4); case 16: return (TP5); case 32: return (TP6); case 64: return (TP7); case 128: return (TP8); case 256: return (TP9); case 512: return (TP10); } return (TP10); }
2016-07-08 09:12
2015-07-31 06:36
210
36517
2016-07-23 15:24
2015-07-31 08:29
2015-03-02 08:55
2012-03-10 05:02
3401
4659888
2018-12-18 03:14
乐汇 发表于 2012-7-27 22:56
static/image/common/back.gif 老师,没看懂?能解释一下吗?
多头听到二号放狠话了,不去95啦
2012-07-27 17:03
号二恩江 发表于 2012-7-23 15:02
static/image/common/back.gif 2086是我的系统可以看到的极限数值,一旦跌破 2076,则系统崩溃,我将按照崩溃的方向小仓做空,目标将是 17 ...
顶大师,同时问一句,按江恩循环理论,感觉有几根4H的反弹,同意否?
2012-07-23 08:19
号二恩江 发表于 2012-7-16 19:05
static/image/common/back.gif 目前这个图形,我不能100%确认欧元可以去 2120下 所以不做了
顶大师,世界是几何的
2012-07-16 11:06
本帖最后由 令狐求败 于 2012-7-1 12:19 编辑
号二恩江 发表于 2012-7-1 11:55
http://www.talkfx.com/static/image/common/back.gif 如果欧元突破 2700,则欧元会在几天内到达 2810( 上下差不了 3 个点)。如果达到2810附近,那么我可能得满 ...
严重同意大师观点,怀疑市场会选择后一种未命名4.JPG
2012-07-01 04:17
2012-07-21 14:58
123
12366
2018-04-23 22:12
猎夫 发表于 2012-7-23 17:04
static/image/common/back.gif 我个人观点,如果楼主没很大压力的话,我觉得楼主提升的空间很大。比论坛最少百分之八十的人水平要高。
猎夫良言啊,估计论坛90%的人都在亏损中,楼主还需努力
2012-07-23 09:20

本站免责声明:

1、本站所有广告及宣传信息均与韬客无关,如需投资请依法自行决定是否投资、斟酌资金安全及交易亏损风险;

2、韬客是独立的、仅为投资者提供交流的平台,网友发布信息不代表韬客的观点与意思表示,所有因网友发布的信息而造成的任何法律后果、风险与责任,均与韬客无关;

3、金融交易存在极高法律风险,未必适合所有投资者,请不要轻信任何高额投资收益的诱导而贸然投资;投资保证金交易导致的损失可能超过您投入的资金和预期。请您考虑自身的投资经验及风险承担能力,进行合法、理性投资;

4、所有投资者的交易帐户应仅限本人使用,不应交由第三方操作,对于任何接受第三方喊单、操盘、理财等操作的投资和交易,由此导致的任何风险、亏损及责任由投资者个人自行承担;

5、韬客不隶属于任何券商平台,亦不受任何第三方控制,韬客不邀约客户投资任何保证金交易,不接触亦不涉及投资者的任何资金及账户信息,不代理任何交易操盘行为,不向客户推荐任何券商平台,亦不存在其他任何推荐行为。投资者应自行选择券商平台,券商平台的任何行为均与韬客无关。投资者注册及使用韬客即表示其接受和认可上述声明,并自行承担法律风险。

版权所有:韬客外汇论坛 www.talkfx.com 联络我们:[email protected]