Skip to content

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

Description

@raul-gherman

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:

// 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.
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions