Download MetaTrader 5

What is the best way to check if a pending order has reached its take profit?

To add comments, please log in or register
Do you have questions on how to turn your idea into reality? Ask them on the Forum!
cxan_96
14
cxan_96 2015.06.16 16:47 

Hello community,

I am currently working on an EA using mql5 and I want to check if a pending order has reached its take profit.
I already thought of going through the list of HistoryDeals to identify the deal that corresponds with the pending order,
but this seemed a little too complicated for such a simple task.

I apologize for my english as I am from Germany.

Thanks in advance!

Chris 

Alain Verleyen
Moderator
30727
Alain Verleyen 2015.06.16 20:21  

A pending order can't reach a take profit, and there is no deals associated. I suppose you mean a position resulting from the triggering of a pending order ?

Anyway, you can't do that from history only (takeprofit are not recorded on history). The easiest way is to detect a deal out, and compare the price with your take profit.

To add comments, please log in or register