⭐ musketeer Posted September 10, 2010 Report Share Posted September 10, 2010 5 Digit brokes problem resumes. Tried Alpari etc... Tried changing the range to 170 etc etc.... Order send error 130... Cheers when you do backtests.... check CURRENT conditions of the broker tester look there - current broker's conditions Quote Link to comment Share on other sites More sharing options...
San4x Posted September 10, 2010 Report Share Posted September 10, 2010 (edited) Can i know how to set it? is that open the cable run2.mq4 and change inside the code?but i cannot find this code (extern int ATR_Period) thanks for help Muruku: Nice work. Cleaned up your code a bit and added some external variables: extern int ATR_Period = 14; extern int ATRPipsLimit = 17; // ATR_Pips need to be smaller than this limit to grant the trade So now we can play with these two variables a bit easier to determine correct settings. Download here: http://www.mediafire.com/?lvtyk4mt0igsnkl Be kind and say Thanks if you like..! Cheers, San. Edited September 10, 2010 by San4x greentrader, sgteo, kimi99 and 4 others 7 Quote Thanks for the kudos...much appreciated! Link to comment Share on other sites More sharing options...
expat1967 Posted September 10, 2010 Report Share Posted September 10, 2010 when you do backtests.... check CURRENT conditions of the broker tester look there - current broker's conditions Thanks, but the Tester stops after placing a few orders appearingly while approaching a Order closing. Cheers Quote Link to comment Share on other sites More sharing options...
juju47 Posted September 10, 2010 Report Share Posted September 10, 2010 Were do you get atr_pips.ex4 Quote Link to comment Share on other sites More sharing options...
San4x Posted September 10, 2010 Report Share Posted September 10, 2010 Were do you get atr_pips.ex4 Uh....read this thread? Seek and thou shall find. Not quite the most brilliant start on your first post here in this forum, now is it? Quote Thanks for the kudos...much appreciated! Link to comment Share on other sites More sharing options...
juju47 Posted September 10, 2010 Report Share Posted September 10, 2010 I found it thank for helping Quote Link to comment Share on other sites More sharing options...
luigifunk Posted September 10, 2010 Report Share Posted September 10, 2010 I've got the " Error: 130 Function: New Order " Quote Link to comment Share on other sites More sharing options...
San4x Posted September 10, 2010 Report Share Posted September 10, 2010 I've got the " Error: 130 Function: New Order " Ordersend Error 130 denotes an invalid stop on the order. Stop (SL) seems too close to price for order to be accepted by broker. Here is more info and how to check/fix it: http://www.earnforex.com/blog/2008/10/ordersend-error-130-what-to-do/Cheers, San luigifunk 1 Quote Thanks for the kudos...much appreciated! Link to comment Share on other sites More sharing options...
luigifunk Posted September 10, 2010 Report Share Posted September 10, 2010 Ordersend Error 130 denotes an invalid stop on the order. Stop (SL) seems too close to price for order to be accepted by broker. Cheers, San Thanks San You're right, i've just run it on a Masterforex Demo without a problem. But my real account is in FxPro and give me that error. Can you help me to insert those variables into the code? In advance thank you very much. luigi Quote Link to comment Share on other sites More sharing options...
muruku Posted September 11, 2010 Report Share Posted September 11, 2010 as far as i know, when an EA had external indicators attached as our case below(icustom).. the EA would never backtestable... so please dun waste your time... go to do something useful.. double ATRPips =iCustom(NULL,PERIOD_M15,"ATR_Pips",0,0); i glanced thru above threads, guess somebody still not well verse how to do things correctly.. below external variable is set in ATR_Pips.mq4 itself. //---input variables extern int ATR_Period=13; & in the EA, double ATRLimit = 12.0; // good at 12 at 11-sep!! .. .. .. double ATRPips =iCustom(NULL,PERIOD_M15,"ATR_Pips",0,0); ... .. if( ATRPips <= ATRLimit && MyOrdersTotal(Magic) == 0) { .. Quote Link to comment Share on other sites More sharing options...
⭐ musketeer Posted September 11, 2010 Report Share Posted September 11, 2010 as far as i know, when an EA had external indicators attached as our case below(icustom).. the EA would never backtestable... there is NO any problem back testing with external indicators - as far as the rest of the code is reliable Quote Link to comment Share on other sites More sharing options...
San4x Posted September 11, 2010 Report Share Posted September 11, 2010 as far as i know, when an EA had external indicators attached as our case below(icustom).. the EA would never backtestable... so please dun waste your time... go to do something useful.. double ATRPips =iCustom(NULL,PERIOD_M15,"ATR_Pips",0,0); i glanced thru above threads, guess somebody still not well verse how to do things correctly.. below external variable is set in ATR_Pips.mq4 itself. //---input variables extern int ATR_Period=13; & in the EA, double ATRLimit = 12.0; // good at 12 at 11-sep!! .. .. .. double ATRPips =iCustom(NULL,PERIOD_M15,"ATR_Pips",0,0); ... .. if( ATRPips <= ATRLimit && MyOrdersTotal(Magic) == 0) { .. I guess you're talking about my mod. What's wrong? Cheers, San. Quote Thanks for the kudos...much appreciated! Link to comment Share on other sites More sharing options...
clevereto Posted September 12, 2010 Report Share Posted September 12, 2010 & in the EA, double ATRLimit = 12.0; // good at 12 at 11-sep!! .. .. .. double ATRPips =iCustom(NULL,PERIOD_M15,"ATR_Pips",0,0); ... .. if( ATRPips <= ATRLimit && MyOrdersTotal(Magic) == 0) { .. I could not find this line in the EA: double ATRLimit = 12.0; // good at 12 at 11-sep!! If I should add it manually, where should I put that line? Thx Quote Link to comment Share on other sites More sharing options...
woelig Posted September 12, 2010 Report Share Posted September 12, 2010 mirror : http://v8no.com/CableRun_muruku.mq4 Quote Link to comment Share on other sites More sharing options...
kimi99 Posted September 12, 2010 Report Share Posted September 12, 2010 Hi all,sorry for asking because i not good in English. So i just want make it clear how to run this EA. 1) Attach the EA by muruku at 1 hour chat G/U. 2) Attach the ATR_pips.ex4 indicator from indicator list. So can change the ATR_pip value. Recommended value=17 from friend here. 3) If want to change the start/end trading time for this EA, is that need to change inside the code for the EA? hope friend here can modify the time setting just at the EA setting, so no need change the code inside:) 4) If i miss anything, hope friend here can help fill up.thanks a lot Quote Link to comment Share on other sites More sharing options...
⭐ pipmaster Posted September 13, 2010 Report Share Posted September 13, 2010 does anyone know the correct recrommended trading time this EA is meant for e.g. 19 - 24 depending on GMT Quote Link to comment Share on other sites More sharing options...
muruku Posted September 13, 2010 Report Share Posted September 13, 2010 i suggest all of us to study ATR_Pips.mq4 based on which optimized setting should be to decide when the market is abt to RANGING/Consolidation period to let this EA to enter/initialize the first trade. Hardcode of Trading time control may gain lesser profit... //---input variables extern int ATR_Period=5; What do you think ? currently i set to 5 for above, & for EA, i set to be <= 9 to open the trades. You should ez spot whenever the incoming news, ATR_Pips.mq4 should be smart enough to filter / prevent EA to turn on the trade... I may not be right/wrong, your folks be self-studied & responsible of your own trades.. dun simply hop onto the bandwagons :) domonkos 1 Quote Link to comment Share on other sites More sharing options...
muruku Posted September 13, 2010 Report Share Posted September 13, 2010 shh.. 70 pips for today...look's like after C*b**Run trade activities in FPA had been quiet after being shared in the forum.. really appreciated good people & good discussion around this forum ! Quote Link to comment Share on other sites More sharing options...
clevereto Posted September 13, 2010 Report Share Posted September 13, 2010 i got 105 pips today, after close all orders manually... it was 159 pips before NY session... :) muruku.. i have no idea why the ea still open orders after 09:00 when i set CableRunEndTime at 09:00: string CableRunStartTime = "0:30"; // 1:00=5.00am myfxbook 7am onwards is good !!!! string CableRunEndTime = "9:00"; // 9:00=1.00pm is the time setting correct? Quote Link to comment Share on other sites More sharing options...
clevereto Posted September 13, 2010 Report Share Posted September 13, 2010 i got 105 pips today, after close all orders manually... it was 159 pips before NY session... :) muruku.. i have no idea why the ea still open orders after 09:00 when i set CableRunEndTime at 09:00: string CableRunStartTime = "0:30"; // 1:00=5.00am myfxbook 7am onwards is good !!!! string CableRunEndTime = "9:00"; // 9:00=1.00pm is the time setting correct? Muruku: Ohh.. Is it because I set parameter "TelagaEmas" to true? Should I set it to false if I want to trade in a specific time? Quote Link to comment Share on other sites More sharing options...
muruku Posted September 14, 2010 Report Share Posted September 14, 2010 Celvereto, you r right, when "telagaEmas" is true, the EA works 24 hrs. (tried to hide as many parameters as we can, although they are far more aware if we r running manual/EA).. The new logic below will let you run 2 set of C*b**Run in same MT platform, discard the usage of GlobalVariableSet that only limit the play of the only 1 C*b**Run . just clone out another set of EA & having them to run with diff magic #... & you will have more pips ! Would like to precaution any fancies abt C*b**Run, better write a logic on SL too. if (TotalProfit(Magic) > MinProfit){ CloseAllTrades(1, Magic); CloseAllTrades(2, Magic); //GlobalVariableSet("OldBalance", 0); } int TotalProfit(int ai_magic) { int total=OrdersTotal(); int totalPips = 0; for (int cnt=0;cnt<total;cnt++) { OrderSelect(cnt, SELECT_BY_POS); int mode=OrderType(); bool condition = false; if (OrderMagicNumber()== ai_magic)condition = true; if (condition) { switch (mode) { case OP_BUY: totalPips += MathRound((MarketInfo(OrderSymbol(),MODE_BID)-OrderOpenPrice())/MarketInfo(OrderSymbol(),MODE_POINT)); break; case OP_SELL: totalPips += MathRound((OrderOpenPrice()-MarketInfo(OrderSymbol(),MODE_ASK))/MarketInfo(OrderSymbol(),MODE_POINT)); break; } } } return(totalPips); } Quote Link to comment Share on other sites More sharing options...
muruku Posted September 14, 2010 Report Share Posted September 14, 2010 Muruku: Ohh.. Is it because I set parameter "TelagaEmas" to true? Should I set it to false if I want to trade in a specific time? why your open orders need to close manually ? below codes are excellent/brutal force way to make sure all open orders are swept cleanly after profit had made. int CloseAllTrades(int ai_0, int ai_magic) { int l_count_8; int l_error_12; int li_16 = 4; int li_20 = 5; int l_ord_total_23 = OrdersTotal(); for (int l_pos_36 = l_ord_total_23 - 1; l_pos_36 >= 0; l_pos_36--) { if (OrderSelect(l_pos_36, SELECT_BY_POS, MODE_TRADES)) { if (OrderSymbol() == Symbol() && OrderMagicNumber()== ai_magic) { l_count_8 = 0; while (l_count_8 < li_16) { switch (OrderType()) { case OP_BUY: if (ai_0 == 0 || ai_0 == 2) { RefreshRates(); OrderClose(OrderTicket(), OrderLots(), Bid, 0, CLR_NONE /*White*/); } break; case OP_SELL: if (ai_0 == 0 || ai_0 == 1) { RefreshRates(); OrderClose(OrderTicket(), OrderLots(), Ask, 0, CLR_NONE/*White*/); } break; case OP_BUYLIMIT: case OP_BUYSTOP: if (ai_0 == 0 || ai_0 == 2) OrderDelete(OrderTicket()); break; case OP_SELLLIMIT: case OP_SELLSTOP: if (ai_0 == 0 || ai_0 == 1) OrderDelete(OrderTicket()); } l_error_12 = GetLastError(); if (l_error_12 == 0/* NO_ERROR */) l_count_8 = li_16; else { l_count_8++; if (l_error_12 == 138/* REQUOTE */ || l_error_12 == 129/* INVALID_PRICE */) continue; if (l_error_12 == 146/* TRADE_CONTEXT_BUSY */) { MySleep(li_20); li_16 = 10; } } } } } else { //Print("CloseAllTrades Error when order select ", GetLastError()); SendMail("LombongBerlian ada Error tutup "+ Period(), WindowExpertName()+" "+GetLastError()); break; } } return (0); } Quote Link to comment Share on other sites More sharing options...
muruku Posted September 14, 2010 Report Share Posted September 14, 2010 i shouldn't invest time in mq4 code as i 'm just parttimer like others working man .. lol, i dun know .. missing logic just attach.. int MySleep(int ai_0) { int l_datetime_4; bool li_8 = FALSE; int l_datetime_12 = TimeLocal(); while (!li_8) { l_datetime_4 = TimeLocal(); if (l_datetime_4 >= l_datetime_12 + ai_0) li_8 = TRUE; else Sleep(500); } return (0); } Quote Link to comment Share on other sites More sharing options...
⭐ pipmaster Posted September 14, 2010 Report Share Posted September 14, 2010 Hi guys a little confused with exactly what's going on in this post. Is one version using bollinger bands or something to enter trades. Is anyone able to upload a modified version of cable run with the other indicator inside the EA. Quote Link to comment Share on other sites More sharing options...
clevereto Posted September 14, 2010 Report Share Posted September 14, 2010 Celvereto, you r right, when "telagaEmas" is true, the EA works 24 hrs. (tried to hide as many parameters as we can, although they are far more aware if we r running manual/EA).. The new logic below will let you run 2 set of C*b**Run in same MT platform, discard the usage of GlobalVariableSet that only limit the play of the only 1 C*b**Run . just clone out another set of EA & having them to run with diff magic #... & you will have more pips ! Would like to precaution any fancies abt C*b**Run, better write a logic on SL too. if (TotalProfit(Magic) > MinProfit){ CloseAllTrades(1, Magic); CloseAllTrades(2, Magic); //GlobalVariableSet("OldBalance", 0); } int TotalProfit(int ai_magic) { int total=OrdersTotal(); int totalPips = 0; for (int cnt=0;cnt<total;cnt++) { OrderSelect(cnt, SELECT_BY_POS); int mode=OrderType(); bool condition = false; if (OrderMagicNumber()== ai_magic)condition = true; if (condition) { switch (mode) { case OP_BUY: totalPips += MathRound((MarketInfo(OrderSymbol(),MODE_BID)-OrderOpenPrice())/MarketInfo(OrderSymbol(),MODE_POINT)); break; case OP_SELL: totalPips += MathRound((OrderOpenPrice()-MarketInfo(OrderSymbol(),MODE_ASK))/MarketInfo(OrderSymbol(),MODE_POINT)); break; } } } return(totalPips); } Thank U so much Bro, I'd love to try how those new logic will work.. 2 Diff set of C*b**Run in one account? I think it's really worth to try.. But honestly I still don't know how to put those logic in the EA :) should I just add it or edit any existing logic? I'm sorry, I still blind about coding mq4.. still new at this.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.