In MQL5 there's a property called DEAL_REASON that could be queried for historical deals, and it will be set to DEAL_REASON_TP if your take profits was hit.
if(HistoryDealGetInteger(dealticket,DEAL_REASON)==DEAL_REASON_TP) ...
Batuhan:
I'm currently using a time and a profit filter for finding trades closed at take profits (my take profits are at 40 pips and I'm searching trades closed with + 30 or more pips for a specified time interval).
Is there a more smarter way of doing this?
Check for string "[tp]" in OrderComment(). I don't know if it works for all brokers so check if your broker is using this tag in comment for trades closed by TP.
Thanks to all.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I'm currently using a time and a profit filter for finding trades closed at take profits (my take profits are at 40 pips and I'm searching trades closed with + 30 or more pips for a specified time interval).
Is there a more smarter way of doing this?