ProtoOaOrderErrorEvent with errorCode: "POSITION_LOCKED" returns no positionID

Created at 10 Feb 2025, 14:02
cTrader Discord
raul_gherman's avatar

raul_gherman

Joined 01.03.2024

ProtoOaOrderErrorEvent with errorCode: "POSITION_LOCKED" returns no positionID
10 Feb 2025, 14:02


maybe it would be useful if returned ProtoOAOrderErrorEvent with errorCode: "POSITION_NOT_FOUND" would include positionId:

ProtoOAOrderErrorEvent {
    payloadType: None,
    ctidTraderAccountId: 4xxxxxxx,
    errorCode: "POSITION_LOCKED",
    orderId: Some(
        0,
    ),
    positionId: Some(
        0,
    ),
    description: None,
}

 

most likely the backend has this info, as it included in errorCode: “POSITION_NOT_FOUND” – maybe it would be more useful if it were returned using the positionId field:

ProtoOAOrderErrorEvent {
    payloadType: None,
    ctidTraderAccountId: 4xxxxxxx,
    errorCode: "POSITION_NOT_FOUND",
    orderId: Some(
        0,
    ),
    positionId: Some(
        0,
    ),
    description: Some(
        "Position not found with id 12345678",
    ),
}

@raul_gherman
Replies

... Deleted by UFO ...

raul_gherman
14 Feb 2025, 18:56

POSITION_NOT_FOUND and POSITION_LOCKED – both could use this

thank you so much for properly pointing that out


@raul_gherman