How to make TakeProfit move forward when its price approaches?

Created at 09 Jun 2023, 13:32
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!
DA

danor60000

Joined 09.06.2023

How to make TakeProfit move forward when its price approaches?
09 Jun 2023, 13:32



 


@danor60000
Replies

firemyst
09 Jun 2023, 15:17

if (distance between current ask or bid price and current take profit price is within x-pips of yourposition.TakeProfit.GetValueOrDefault())

{

    yourPosition.ModifyTakeProfitPrice( yourposition.TakeProfit.GetValueOrDefault() + (Symbol.PipSize * number of pips you want to move it forward);

}


@firemyst