Finding the trades closed at take profits

To add comments, please log in or register
Batuhan
89
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?

lippmaje
417
lippmaje  

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) ...
Marcin Madrzak
485
Marcin Madrzak  
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.

whroeder1
18099
whroeder1  
  1. Not all brokers modify comments
  2. check if the OCP is closer to the OTP vs OSL
Batuhan
89
Batuhan  
Thanks to all.
To add comments, please log in or register