How to Track Trades closed by Stop Loss or Take Profit

 
Hi everyone, I am a beginner in Mql4 programming. I am creating an EA that can track trades closed by Stop loss or Take profit and use that information to further process the EA for the current trade session. I am thinking of doing this by tracking changes in account balance using AccountBalance() function. But I want to know if there is a better way to do this especially using OrderSelect. I will appreciate it if you drop some code. 
 
pirokele:
Hi everyone, I am a beginner in Mql4 programming. I am creating an EA that can track trades closed by Stop loss or Take profit and use that information to further process the EA for the current trade session. I am thinking of doing this by tracking changes in account balance using AccountBalance() function. But I want to know if there is a better way to do this especially using OrderSelect. I will appreciate it if you drop some code. 

Welcome to Mql .

Do you want to track your Ea's trades ? [the best solution is to have an array which you maintain and then check the close price]

Track all trades in general and provide stats ? [perhaps as above but you will also have a sequence where you check if a trade is in your tracking list]

Reason: