eggzactly Posted September 23, 2010 Report Share Posted September 23, 2010 Hi eggzactly, I have insert your codes inside the EA. Just want to check with you if I am correct in the EA variables declaration and the function int pmode; double Pips = TotalProfit(pmode,Magic); if (Pips >= MinProfit){ CloseAllTrades(0,Magic); DeletePendingOrders(Magic); } Do I need to put CloseAllTrades(1, Magic); CloseAllTrades(2, Magic); Since this is declare on top inside the init start() What does CloseAllTrades(1, Magic); , CloseAllTrades(2, Magic); and CloseAllTrades(0, Magic); means? Hi, int pmode; = i put int pmode = 2 ; - for totalpips profit I just use this to close all my trades, // --- Close Orders int CloseOrders(int magic) { int numords; numords = OrdersTotal(); for (int cnt = numords - 1; cnt >= 0; cnt--) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if (OrderMagicNumber() == magic && OrderSymbol() == Symbol()) { if (OrderType() == OP_BUY) OrderClose(OrderTicket(), OrderLots(), Bid, Slippage); if (OrderType() == OP_SELL) OrderClose(OrderTicket(), OrderLots(), Ask, Slippage); } } return (0); } regards, eggzactly Quote Link to comment Share on other sites More sharing options...
metin Posted September 23, 2010 Report Share Posted September 23, 2010 string CableRunStartTime = string CableRunEndTime = string CableRunNOTtoTradesTime1 = string CableRunNOTtoTradesTime2 = can somebody please tell me the correct times for the parameters above for GMT+3 (My localtime) timeframe? I couldn't manage it. Thanks in advance, Metin Quote Link to comment Share on other sites More sharing options...
eggzactly Posted September 23, 2010 Report Share Posted September 23, 2010 string CableRunStartTime = string CableRunEndTime = string CableRunNOTtoTradesTime1 = string CableRunNOTtoTradesTime2 = can somebody please tell me the correct times for the parameters above for GMT+3 (My localtime) timeframe? I couldn't manage it. Thanks in advance, Metin Check this site, you can learn how to do it for all your EA´s http://wwp.greenwichmeantime.com/ regards, eggzactly Quote Link to comment Share on other sites More sharing options...
metin Posted September 24, 2010 Report Share Posted September 24, 2010 Check this site, you can learn how to do it for all your EA´s http://wwp.greenwichmeantime.com/ regards, eggzactly Eggzactly, thank you. I meant I'm confused of the coding shown in the timing strings as below (azam's EA): // Suggested Active 5am until 4pm at GMT +8 string CableRunStartTime = "0:00"; // 1:00=6.00am myfxbook 7am onwards is good !!!! string CableRunEndTime = "9:30"; // 9:00=2.00pm string CableRunNOTtoTradesTime1 = "20:00"; //<-- this is your pc local time (=NY 8am) string CableRunNOTtoTradesTime2 = "01:30"; //(=NY 1.30pm) How come "suggested active 5am= 0:00 and 4pm=9:30" at GMT+8 ; what's the base time to take, broker's server time or local time? I'm really confused... Best regards, Metin Quote Link to comment Share on other sites More sharing options...
mrbizu Posted September 24, 2010 Report Share Posted September 24, 2010 Anyone, please explain me how the EA run with 2 this function "string CableRunNOTtoTradesTime1 = string CableRunNOTtoTradesTime2 = " ? Thanks alot Quote Link to comment Share on other sites More sharing options...
muruku Posted September 24, 2010 Report Share Posted September 24, 2010 Global variable for below ... these are fx server time int EntryHourFrom = 1; // 5am int EntryHourTo = 13; // 6pm still can trade int ExitHour = 14; // Stop trade if(!TelagaEmas && !IsTradeTime()) { DeletePendingOrders(Magic); return (0);} The sub. bool IsTradeTime() { bool Result=false; if((EntryHourFrom<=EntryHourTo && Hour()>=EntryHourFrom && Hour()<=EntryHourTo) || (EntryHourFrom>EntryHourTo && (Hour()>=EntryHourFrom || Hour()<=EntryHourTo))) { Result=true; if(Hour()>=ExitHour) if((EntryHourFrom<=EntryHourTo && ExitHour>=EntryHourFrom) || (EntryHourFrom>EntryHourTo && ExitHour>=EntryHourFrom) || (EntryHourFrom>EntryHourTo && ExitHour<=EntryHourTo)) Result=false; } return(Result); } Discard this logic below Anyone, please explain me how the EA run with 2 this function "string CableRunNOTtoTradesTime1 = string CableRunNOTtoTradesTime2 = " ? Thanks alot mrbizu 1 Quote Link to comment Share on other sites More sharing options...
⭐ pipmaster Posted September 24, 2010 Report Share Posted September 24, 2010 Hey anyone know about coding EA's? Or tried Profitability EA it runs on m30 on EU and might be a grid kind of design but just seems to enter trades at the wrong time if could mix it with cable run or something might be able to improve it. Quote Link to comment Share on other sites More sharing options...
muruku Posted September 24, 2010 Report Share Posted September 24, 2010 i see your problem that i had before.. just tweak this logic will make the world happy, so you had to be creative & analytical to know what the problem you had, what resources you had to solve it if (Pips >= MinProfit){ while(MyOrdersTotal(Magic) != 0) { CloseAllTrades(0,Magic); DeletePendingOrders(Magic); } } Hi muruku, I have tried your function double Pips = TotalProfit(Magic); if (Pips >= MinProfit){ CloseAllTrades(0,Magic); DeletePendingOrders(Magic); } which called the function below. int TotalProfit(int 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()== 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); } I observe my account which is floating more than $30 in profits, but the EA still did not closed all the trades? By the way, my broker is a 5 digit no, hence, I change the value for step and MinProfit to be 170 and 150 int Step = 170; // org 17 .. still stick to 17 extern double FirstLot = 0.01; // org 0.10 .. risky .. so just put 0.1 double IncLot = 0.0; // org 0.0 double MinProfit = 150; // org 15 Would that be the cause to all orders not closed? Quote Link to comment Share on other sites More sharing options...
muruku Posted September 24, 2010 Report Share Posted September 24, 2010 Who's got the happy PIPS this week ? I got 612 ... Quote Link to comment Share on other sites More sharing options...
leonytham Posted September 24, 2010 Report Share Posted September 24, 2010 Who's got the happy PIPS this week ? I got 612 ... i am live with cable EA version #171 (azam575) with necessary indicator at #187 (muruku) for around 72hours. manage to get +6.5% profit (default setting, 2 pairs, GU EJ, instaforex cent from USD460 to USD490, now still float +USD11) Hope this EA will be a long term constant profitable EA :) Thank you to muruku (and fellow indo-investasi friends) :) Quote Link to comment Share on other sites More sharing options...
azam575 Posted September 24, 2010 Report Share Posted September 24, 2010 what is your lot trading ? is it 0.01 or 0.1 of 1.0 ? Quote Link to comment Share on other sites More sharing options...
tongtoro Posted September 24, 2010 Report Share Posted September 24, 2010 Who's got the happy PIPS this week ? I got 612 ... hi muruku what version do you used?. Can u share to us? This bot good on asian market or amerika market? Thanks Quote Link to comment Share on other sites More sharing options...
muruku Posted September 24, 2010 Report Share Posted September 24, 2010 Azam, this is depends on each trader's MM... R u getting happy PIPS too ? what is your lot trading ? is it 0.01 or 0.1 of 1.0 ? Quote Link to comment Share on other sites More sharing options...
muruku Posted September 24, 2010 Report Share Posted September 24, 2010 i 'm running 24 hrs .. so can this considered all session bot LOL .... you can look thru all the threads & easily get one... hi muruku what version do you used?. Can u share to us? This bot good on asian market or amerika market? Thanks Quote Link to comment Share on other sites More sharing options...
gigamax Posted September 24, 2010 Report Share Posted September 24, 2010 Who's got the happy PIPS this week ? I got 612 ... Hi muruku, you're the best .Original (demo at forexpeacearmy) made 303. Congrats!!! Quote Link to comment Share on other sites More sharing options...
micutzu Posted September 24, 2010 Report Share Posted September 24, 2010 Who's got the happy PIPS this week ? I got 612 ... can u upload your version Quote Link to comment Share on other sites More sharing options...
leonytham Posted September 24, 2010 Report Share Posted September 24, 2010 what is your lot trading ? is it 0.01 or 0.1 of 1.0 ? i am trading 0.1 lot (instaforex is 0.1Lot=usd0.10) azam575 1 Quote Link to comment Share on other sites More sharing options...
muruku Posted September 24, 2010 Report Share Posted September 24, 2010 you can easily find any from this forum thread. can u upload your version Quote Link to comment Share on other sites More sharing options...
tgt123 Posted September 24, 2010 Report Share Posted September 24, 2010 Hi muruku, I saw there is a buystop, sellstop in coding, does it works?. What is the function of his pending order in coding. Thanks. It seem when all the total floating profit reach MinProfit = 1.5 or 1.5 t/p reach it wont close all the position including the pending order. I'm testing the code by Azam. Quote Link to comment Share on other sites More sharing options...
shady2500 Posted September 24, 2010 Report Share Posted September 24, 2010 can anyone help us with ultimate version Quote Link to comment Share on other sites More sharing options...
shady2500 Posted September 24, 2010 Report Share Posted September 24, 2010 and please tell us what is the best time of trading for this ea!! Quote Link to comment Share on other sites More sharing options...
azam575 Posted September 24, 2010 Report Share Posted September 24, 2010 Hi muruku, I saw there is a buystop, sellstop in coding, does it works?. What is the function of his pending order in coding. Thanks. It seem when all the total floating profit reach MinProfit = 1.5 or 1.5 t/p reach it wont close all the position including the pending order. I'm testing the code by Azam. for closing the order.... i`m using other basket close ea :D ..... Quote Link to comment Share on other sites More sharing options...
azam575 Posted September 24, 2010 Report Share Posted September 24, 2010 i am trading 0.1 lot (instaforex is 0.1Lot=usd0.10) same as me though :D ..... trade live on instafx ..... Quote Link to comment Share on other sites More sharing options...
azam575 Posted September 24, 2010 Report Share Posted September 24, 2010 and please tell us what is the best time of trading for this ea!! i`m running 24H on 3 pair with FXclering cent account .... running 2 instances on GU with Instafx .... 1 instances trade 24H but avoided london open and 1 instances just traded on asian sleep time :D p/s: sorry for my bad english... not my native language :D shady2500 1 Quote Link to comment Share on other sites More sharing options...
azam575 Posted September 24, 2010 Report Share Posted September 24, 2010 Azam, this is depends on each trader's MM... R u getting happy PIPS too ? Thanks to you, muruku ... i`m happy pipping :D 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.