forex4love Posted March 19, 2010 Report 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
scarface Posted March 19, 2010 Report 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 a New Year 2011 has come, and the challenge has just started 8-)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now