Set TakeProfit To Zero / open

Created at 24 May 2023, 09:06
CT

ctid5696420

Joined 17.02.2023

Set TakeProfit To Zero / open
24 May 2023, 09:06


Hi,

 

I currently have an active position with set values for Stop Loss (SL) and Take Profit (TP). However, I would like to set the Take Profit value to open, meaning that I want to remove the specific TP value and keep it undefined. I am using the cTrader Open API and wondering how I can achieve this.

Although I can successfully update the SL/TP using the ProtoOAAmendPositionSLTPReq method, I haven't been able to find a way to simply open the TP without specifying a value. Can you please assist me in achieving this using the cTrader Open API?

 var message = new ProtoMessage
                        {
                            Payload = new ProtoOAAmendPositionSLTPReq
                            {
                                CtidTraderAccountId = CtidTraderAccountId,
                                PositionId = PositionId,
                                StopLoss = (double)stoploss,
                                TakeProfit = double.NaN,    /////What Value Do I need to Pass Here ??????

                            }.ToByteString(),
                            PayloadType = (int)ProtoOAPayloadType.ProtoOaAmendPositionSltpReq,
                        };
                        return message;

Thank You.


@ctid5696420