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?
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.
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.