Topics

Forum Topics not found

Replies

jesustotten735
09 May 2024, 03:57 ( Updated at: 10 May 2024, 03:00 )

Hello @merge fruit, to open the Take Profit (TP) value without specifying a specific value using the cTrader Open API, you can set the TakeProfit field to null or remove it from the request altogether. Here's an example of how you can modify your code:

csharpvar message = new ProtoMessage{   Payload = new ProtoOAAmendPositionSLTPReq   {       CtidTraderAccountId = CtidTraderAccountId,       PositionId = PositionId,       StopLoss = (double)stoploss,       TakeProfit = null, // Set TakeProfit to null or remove the field   }.ToByteString(),   PayloadType = (int)ProtoOAPayloadType.ProtoOaAmendPositionSltpReq,};return message;

@jesustotten735