Implement Req & Res & backend methods to return open orders / positions only considering ctidTraderAccountId and SymbolID

Created at 15 Jan 2025, 05:04
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!
raul_gherman's avatar

raul_gherman

Joined 01.03.2024

Implement Req & Res & backend methods to return open orders / positions only considering ctidTraderAccountId and SymbolID
15 Jan 2025, 05:04


same request as posted here: https://github.com/spotware/openapi-proto-messages/issues/28

currently, ProtoOAReconcileRes returns all open orders and open positions for ctidTraderAccountId

implementing i.e. GetOpenOrdersBySymbolIdReq --> GetOpenOrdersBySymbolIdRes could prove very useful for traders sporting many open orders / positions spanning across multiple symbols

potential .proto definitions:

```protobuf

// Request for getting Trader current open positions filtered by SymbolID.
message ProtoOAGetOpenPositionsBySymbolIdReq
{
   optional ProtoOAPayloadType payloadType            = 1  [default = PROTO_OA_GET_OPEN_POSITIONS_BY_SIMBOLD_ID_REQ];
   required int64              ctidTraderAccountId    = 2; // Unique identifier of the trading account. Used to match responses to trading accounts.
   repeated int64              symbolId               = 3; // Unique identifier of the Symbol in cTrader platform.
}

// Response for ProtoOAGetOpenPositionsBySymbolIdReq request.
message ProtoOAGetOpenPositionsBySymbolIdRes
{
   optional ProtoOAPayloadType payloadType         = 1  [default = PROTO_OA_GET_OPEN_POSITIONS_BY_SIMBOLD_ID_RES];
   required int64              ctidTraderAccountId = 2; // Unique identifier of the trading account. Used to match responses to trading accounts.
   repeated ProtoOAPosition    position            = 3; // The list of trading account open positions.
}

// Request for getting Trader current open pending orders filtered by SymbolID.
message ProtoOAGetOpenOrdersBySymbolIdReq
{
   optional ProtoOAPayloadType payloadType            = 1  [default = PROTO_OA_GET_OPEN_ORDERS_BY_SIMBOLD_ID_REQ];
   required int64              ctidTraderAccountId    = 2; // Unique identifier of the trading account. Used to match responses to trading accounts.
   repeated int64              symbolId               = 3; // Unique identifier of the Symbol in cTrader platform.
}

// Response for ProtoOAGetOpenOrdersBySymbolIdReq request.
message ProtoOAGetOpenOrdersBySymbolIdRes
{
   optional ProtoOAPayloadType payloadType         = 1  [default = PROTO_OA_GET_OPEN_ORDERS_BY_SIMBOLD_ID_RES];
   required int64              ctidTraderAccountId = 2; // Unique identifier of the trading account. Used to match responses to trading accounts.
   repeated ProtoOAOrder       order               = 3; // The list of trading account pending orders.
}


``` 


@raul_gherman