Jump to content

Recommended Posts

Posted

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

Posted

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-)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...