Positions have "ModifyTakeProfitPrice". PendingOrders only have "ModifyTakeProfitPips"??

Created at 02 Sep 2021, 16:01
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!
BE

belasto

Joined 11.02.2019

Positions have "ModifyTakeProfitPrice". PendingOrders only have "ModifyTakeProfitPips"??
02 Sep 2021, 16:01


Why do Positions have "ModifyTakeProfitPrice" method, but PendingOrders only have "ModifyTakeProfitPips"?

Did I miss something? Or does it makes sense somehow? I dont understand and would love to have this method at the moment.


@belasto
Replies

PanagiotisCharalampous
02 Sep 2021, 16:33

Hi belasto,

Orders accept only relative SL/TP values since do not know the actual execution price. Absolute SL and TP values are calculated only after an order has been placed. Else there is a danger of placing invalid SL/TP values.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

belasto
02 Sep 2021, 19:51

RE:

Thanks for the answer. It makes sense this way. However, maybe you can help me with a workaround? Not such a big deal I assume, but I am not sure how to get there.
I am creating one initial Position and 4 PendingOrders afterwards, some kind of grid trading approach. I'd like to give the PendingOrders the same TP as the initial Position. I could add listener on PendingOrder filled and immediately adjust the TP, but is there an easy way to adjust it in advance?

 


@belasto

PanagiotisCharalampous
03 Sep 2021, 07:57

Hi belasto,

After the order is triggered, you can modify your position's TP. You can listen to the Position.Opened event and then use ModifyTakeProfitPrice to set your desired TP price.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous