forex4love Posted March 19, 2010 Report Share Posted March 19, 2010 Maybe someone in here can help me for make script EA for Close Entry Order. Example: My EA running 24 hour non stop, so I want to close all entry order my EA in 23.00 GMT for Intraday Trading. Thank before, Kudos for Your Help Quote Link to comment Share on other sites More sharing options...
scarface Posted March 19, 2010 Report Share Posted March 19, 2010 Re: {Reg} Script for Close All Entry Order EA HI forex4love, Good day, //+------------------------------------------------------------------+ //| CloseOnTime.mq4 | //| [url]http://www.kimiv.ru[/url] | //+------------------------------------------------------------------+ #property copyright "" #property link "http://www.kimiv.ru" //---- input parameters extern int CloseHour=23; extern int CloseMinute=55; int start() { int cnt, ticket, total; if (Hour() == CloseHour && Minute() >= CloseMinute) { total=OrdersTotal(); for (cnt=0; cnt < total ;cnt++) { if (OrderType() == OP_BUY) { OrderClose(OrderTicket(), OrderLots(), Bid, 3, Yellow); return(0); // exit } if (OrderType() == OP_SELL) { OrderClose(OrderTicket(), OrderLots(), Ask, 3, Yellow); return(0); // exit } } } return(0); } I guess this script would do. Best wishes, SF Quote a New Year 2011 has come, and the challenge has just started 8-) 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.