a piece of code to trigger an action when an order is closed at its stop loss

 

For modifying an EA, I need a piece of code to trigger an action when any order is closed at its stop loss.

I hope that there is a more simple way rather than checking the status of all orders through OrderSelect etc. After all, the terminal window receives that information from the server and displays it immediately.

I would appreciate any examples or hints how to write the code.


 

There is only one way as you said:

checking the status of all orders through OrderSelect etc

Reason: