OP_BUYLIMIT Expiration Time

Back to topics list  | 1 2 To post a new topic, please log in or register
avatar
14167
RaptorUK 2012.01.12 12:45 #
 
Did you read what error 147 means ?
avatar
12985
WHRoeder 2012.01.12 13:45 #
 
wackena:
In this example, the expiration time is 0. I need example of pending order "Good for the Day Only".
  1. TimeCurrent()+84600 is an expiration good for 23.5 hours. It does not end at the end of the day.
    datetime now        = TimeCurrent(),
             bod        = now - now % 86400, // Beginning of the day
             tomorrow   = bod + 86400,
             expiration = tomorrow - 1;


  2. RaptorUK:
    Did you read what error 147 means ?
    Did you as Raptor asked?
avatar
3134
qjol 2012.01.12 14:15 #
 

as RaptorUK wrote

RaptorUK 2012.01.12 12:45

Did you read what error 147 means ?


ERR_TRADE_EXPIRATION_DENIED 147 Expirations are denied by broker.

so, call your broker

 
avatar
63
Route206 2015.10.24 08:58 #
 
WHRoeder:
  1. datetime now        = TimeCurrent(),
             bod        = now - now % 86400, // Beginning of the day
             tomorrow   = bod + 86400,
             expiration = tomorrow - 1;

So simple and effective.. Great!

Thanks. 

avatar
9
Uncl3B0B 2015.10.26 13:20 #
 
When I cant set time for the expiration of pending order less than 600 second,  how to set it in EA? I need to close/delete pending order 1,2 or 3 minutes after entering. How to do it?
THX
avatar
Moderator
3407
GumRai 2015.10.26 13:42 #
 
Uncl3B0B:
When I cant set time for the expiration of pending order less than 600 second,  how to set it in EA? I need to close/delete pending order 1,2 or 3 minutes after entering. How to do it?
THX

Check that the OrderType() is not OP_BUY or OP_SELL ( that means that the order has not been triggered)

if TimeCurrent() -OrderOpenTime()>=nMinutes*60

Delete the order 

avatar
9
Uncl3B0B 2015.11.02 11:46 #
 

It works like this (so far :)

 

if (TimeCurrent() - OrderOpenTime()>=4*60)
  for(p = 0; p < OrdersTotal(); p++)
    {if (OrderSelect (p, SELECT_BY_POS, MODE_TRADES )&& OrderMagicNumber()==MN)
     {if (OrderType() == OP_BUYSTOP || OP_SELLSTOP) result =  OrderDelete(OrderTicket(),Yellow);} }

 THX

Back to topics list   | 1 2  

To add comments, please log in or register