How to know if a position hit SL / TP (trailing SL)

Created at 14 Apr 2020, 18:57
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
CO

contact.bitq

Joined 11.04.2020

How to know if a position hit SL / TP (trailing SL)
14 Apr 2020, 18:57


I index the position in my local memory to maximize the access speed.

In onTick() function,  I need to know if a position hit SL / hit TP to remove it from my index.

Can you suggest a best workaround for performance?


@contact.bitq
Replies

PanagiotisCharalampous
15 Apr 2020, 08:25

Hi contact.bitq,

You can check the reason which caused the position to close using PositionCloseReason provided in the Position.Closed event arguments.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous