Need help to delete pending orders if the 1st doesn't trigger.
-
Hi everyone, I need some help here. After my conditions are met, I have a Buy Now order waiting to execute followed by a set of pending orders. The problem is, sometimes the 1st Buy Order doesn't activate immediately and a Buy Limit is automatically created instead. That's ok but I want to delete all orders if 1 hour passes and the 1st Buy Limit isn't activated.
shared/v4bc5xqId
-
@FX-EA You can specify an expiration time here:

-
@FX-EA
buy order not activating immediately could either be as a result of your internet connection speed or the market conditions itself.Buy limit usually occurs if the next price bar has an opening price higher than the calculated price of entry of your buy order.
Alternative way of delete pending orders is by creating "once per bar" button with "one hour" timeframe setting and adding "delete pending orders" block under it before including any other block beside it.
-
@l-andorrà said in Need help to delete pending orders if the 1st doesn't trigger.:
@FX-EA You can specify an expiration time here:

Thanks for replying. I am aware of this option but it doesn't solve my problem. The expiry time only closes the 1st order. I want to basically close all remaining pending orders ONLY IF the 1st order expires. Else if the 1st order remains open all other following pending orders must also remain open.
-
Set up different trees, if condition met, delete all pending orders.
-
@FX-EA
This is how I've done it. Left side for Sells and right side for Buys. The "oco15" constant is only relevant to my 15th Parameter set;

-
This way you can turn off "One Cancels Other" if you're straddling price and not wanting to worry about a stray Pending Order.