Download MetaTrader 5

Trade event & Pending Orders

To add comments, please log in or register
Find out how to add a video in the messages editor
jimbernice
33
jimbernice 2014.09.12 15:59 
Is it possible for an EA to 'catch' a pending order  (using the Trade Event?) just before it is about to be executed, so that it can be checked to see its values are still relevant?
Alain Verleyen
Moderator
30755
Alain Verleyen 2014.09.12 16:35  
jimbernice:
Is it possible for an EA to 'catch' a pending order  (using the Trade Event?) just before it is about to be executed, so that it can be checked to see its values are still relevant?

If it's BEFORE the pending order is about to be executed, you don't need a trade event, it doesn't exist yet.

Pending orders are manageable with OrdersTotal(), OrderGetInteger(), OrderGetDouble() functions.

jimbernice
33
jimbernice 2014.09.12 17:41  
angevoyageur:

If it's BEFORE the pending order is about to be executed, you don't need a trade event, it doesn't exist yet.

Pending orders are manageable with OrdersTotal(), OrderGetInteger(), OrderGetDouble() functions.

Thanks for your answer.

I guess I really need a pre-trade event, which will alert my EA that a pending order is about to be executed so that it can check the price and indicators and delete the order if it is obsolete or  execute it if all is well.

I can write code to do this, but I was hoping there might be an existing type of event I could use.

Alain Verleyen
Moderator
30755
Alain Verleyen 2014.09.12 18:51  
jimbernice:

Thanks for your answer.

I guess I really need a pre-trade event, which will alert my EA that a pending order is about to be executed so that it can check the price and indicators and delete the order if it is obsolete or  execute it if all is well.

I can write code to do this, but I was hoping there might be an existing type of event I could use.

There is no such event, one way to code it can be with a Custom event.
To add comments, please log in or register