#[non_exhaustive]pub enum OrderCancelReason {
Show 66 variants
InternalServerError,
AccountLocked,
AccountNewPositionsLocked,
AccountOrderCreationLocked,
AccountOrderFillLocked,
ClientRequest,
Migration,
MarketHalted,
LinkedTradeClosed,
TimeInForceExpired,
InsufficientMargin,
FifoViolation,
BoundsViolation,
ClientRequestReplaced,
DividendAdjustmentReplaced,
InsufficientLiquidity,
TakeProfitOnFillGtdTimestampInPast,
TakeProfitOnFillLoss,
LosingTakeProfit,
StopLossOnFillGtdTimestampInPast,
StopLossOnFillLoss,
StopLossOnFillPriceDistanceMaximumExceeded,
StopLossOnFillRequired,
StopLossOnFillGuaranteedRequired,
StopLossOnFillGuaranteedNotAllowed,
StopLossOnFillGuaranteedMinimumDistanceNotMet,
StopLossOnFillGuaranteedLevelRestrictionExceeded,
StopLossOnFillGuaranteedHedgingNotAllowed,
StopLossOnFillTimeInForceInvalid,
StopLossOnFillTriggerConditionInvalid,
GuaranteedStopLossOnFillGtdTimestampInPast,
GuaranteedStopLossOnFillLoss,
GuaranteedStopLossOnFillPriceDistanceMaximumExceeded,
GuaranteedStopLossOnFillRequired,
GuaranteedStopLossOnFillNotAllowed,
GuaranteedStopLossOnFillMinimumDistanceNotMet,
GuaranteedStopLossOnFillLevelRestrictionVolumeExceeded,
GuaranteedStopLossOnFillLevelRestrictionPriceRangeExceeded,
GuaranteedStopLossOnFillHedgingNotAllowed,
GuaranteedStopLossOnFillTimeInForceInvalid,
GuaranteedStopLossOnFillTriggerConditionInvalid,
TakeProfitOnFillPriceDistanceMaximumExceeded,
TrailingStopLossOnFillGtdTimestampInPast,
ClientTradeIdAlreadyExists,
PositionCloseoutFailed,
OpenTradesAllowedExceeded,
PendingOrdersAllowedExceeded,
TakeProfitOnFillClientOrderIdAlreadyExists,
StopLossOnFillClientOrderIdAlreadyExists,
GuaranteedStopLossOnFillClientOrderIdAlreadyExists,
TrailingStopLossOnFillClientOrderIdAlreadyExists,
PositionSizeExceeded,
HedgingGsloViolation,
AccountPositionValueLimitExceeded,
InstrumentBidReduceOnly,
InstrumentAskReduceOnly,
InstrumentBidHalted,
InstrumentAskHalted,
StopLossOnFillGuaranteedBidHalted,
StopLossOnFillGuaranteedAskHalted,
GuaranteedStopLossOnFillBidHalted,
GuaranteedStopLossOnFillAskHalted,
FifoViolationSafeguardViolation,
FifoViolationSafeguardPartialCloseViolation,
OrdersOnFillRmoMutualExclusivityMutuallyExclusiveViolation,
Unknown(String),
}Expand description
The reason that an Order was cancelled.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InternalServerError
The Order was cancelled because at the time of filling, an unexpected internal server error occurred.
AccountLocked
The Order was cancelled because at the time of filling the account was locked.
AccountNewPositionsLocked
The order was to be filled, however the account is configured to not allow new positions to be created.
AccountOrderCreationLocked
Filling the Order wasn’t possible because it required the creation of a dependent Order and the Account is locked for Order creation.
AccountOrderFillLocked
Filling the Order was not possible because the Account is locked for filling Orders.
ClientRequest
The Order was cancelled explicitly at the request of the client.
Migration
The Order cancelled because it is being migrated to another account.
MarketHalted
Filling the Order wasn’t possible because the Order’s instrument was halted.
LinkedTradeClosed
The Order is linked to an open Trade that was closed.
TimeInForceExpired
The time in force specified for this order has passed.
InsufficientMargin
Filling the Order wasn’t possible because the Account had insufficient margin.
FifoViolation
Filling the Order would have resulted in a a FIFO violation.
BoundsViolation
Filling the Order would have violated the Order’s price bound.
ClientRequestReplaced
The Order was cancelled for replacement at the request of the client.
DividendAdjustmentReplaced
The Order was cancelled for replacement with an adjusted fillPrice to accommodate for the price movement caused by a dividendAdjustment.
InsufficientLiquidity
Filling the Order wasn’t possible because enough liquidity available.
TakeProfitOnFillGtdTimestampInPast
Filling the Order would have resulted in the creation of a Take Profit Order with a GTD time in the past.
TakeProfitOnFillLoss
Filling the Order would result in the creation of a Take Profit Order that would have been filled immediately, closing the new Trade at a loss.
LosingTakeProfit
Filling the Order would result in the creation of a Take Profit Loss Order that would close the new Trade at a loss when filled.
StopLossOnFillGtdTimestampInPast
Filling the Order would have resulted in the creation of a Stop Loss Order with a GTD time in the past.
StopLossOnFillLoss
Filling the Order would result in the creation of a Stop Loss Order that would have been filled immediately, closing the new Trade at a loss.
StopLossOnFillPriceDistanceMaximumExceeded
Filling the Order would result in the creation of a Stop Loss Order whose price would be zero or negative due to the specified distance.
StopLossOnFillRequired
Filling the Order would not result in the creation of Stop Loss Order, however the Account’s configuration requires that all Trades have a Stop Loss Order attached to them.
StopLossOnFillGuaranteedRequired
Filling the Order would not result in the creation of a guaranteed Stop Loss Order, however the Account’s configuration requires that all Trades have a guaranteed Stop Loss Order attached to them.
StopLossOnFillGuaranteedNotAllowed
Filling the Order would result in the creation of a guaranteed Stop Loss Order, however the Account’s configuration does not allow guaranteed Stop Loss Orders.
StopLossOnFillGuaranteedMinimumDistanceNotMet
Filling the Order would result in the creation of a guaranteed Stop Loss Order with a distance smaller than the configured minimum distance.
StopLossOnFillGuaranteedLevelRestrictionExceeded
Filling the Order would result in the creation of a guaranteed Stop Loss Order with trigger price and number of units that that violates the account’s guaranteed Stop Loss Order level restriction.
StopLossOnFillGuaranteedHedgingNotAllowed
Filling the Order would result in the creation of a guaranteed Stop Loss Order for a hedged Trade, however the Account’s configuration does not allow guaranteed Stop Loss Orders for hedged Trades/Positions.
StopLossOnFillTimeInForceInvalid
Filling the Order would result in the creation of a Stop Loss Order whose TimeInForce value is invalid. A likely cause would be if the Account requires guaranteed stop loss orders and the TimeInForce value were not GTC.
StopLossOnFillTriggerConditionInvalid
Filling the Order would result in the creation of a Stop Loss Order whose TriggerCondition value is invalid. A likely cause would be if the stop loss order is guaranteed and the TimeInForce is not TRIGGER_DEFAULT or TRIGGER_BID for a long trade, or not TRIGGER_DEFAULT or TRIGGER_ASK for a short trade.
GuaranteedStopLossOnFillGtdTimestampInPast
Filling the Order would have resulted in the creation of a Guaranteed Stop Loss Order with a GTD time in the past.
GuaranteedStopLossOnFillLoss
Filling the Order would result in the creation of a Guaranteed Stop Loss Order that would have been filled immediately, closing the new Trade at a loss.
GuaranteedStopLossOnFillPriceDistanceMaximumExceeded
Filling the Order would result in the creation of a Guaranteed Stop Loss Order whose price would be zero or negative due to the specified distance.
GuaranteedStopLossOnFillRequired
Filling the Order would not result in the creation of a Guaranteed Stop Loss Order, however the Account’s configuration requires that all Trades have a Guaranteed Stop Loss Order attached to them.
GuaranteedStopLossOnFillNotAllowed
Filling the Order would result in the creation of a Guaranteed Stop Loss Order, however the Account’s configuration does not allow Guaranteed Stop Loss Orders.
GuaranteedStopLossOnFillMinimumDistanceNotMet
Filling the Order would result in the creation of a Guaranteed Stop Loss Order with a distance smaller than the configured minimum distance.
GuaranteedStopLossOnFillLevelRestrictionVolumeExceeded
Filling the Order would result in the creation of a Guaranteed Stop Loss Order with trigger number of units that violates the account’s Guaranteed Stop Loss Order level restriction volume.
GuaranteedStopLossOnFillLevelRestrictionPriceRangeExceeded
Filling the Order would result in the creation of a Guaranteed Stop Loss Order with trigger price that violates the account’s Guaranteed Stop Loss Order level restriction price range.
GuaranteedStopLossOnFillHedgingNotAllowed
Filling the Order would result in the creation of a Guaranteed Stop Loss Order for a hedged Trade, however the Account’s configuration does not allow Guaranteed Stop Loss Orders for hedged Trades/Positions.
GuaranteedStopLossOnFillTimeInForceInvalid
Filling the Order would result in the creation of a Guaranteed Stop Loss Order whose TimeInForce value is invalid. A likely cause would be if the Account requires guaranteed stop loss orders and the TimeInForce value were not GTC.
GuaranteedStopLossOnFillTriggerConditionInvalid
Filling the Order would result in the creation of a Guaranteed Stop Loss Order whose TriggerCondition value is invalid. A likely cause would be the TimeInForce is not TRIGGER_DEFAULT or TRIGGER_BID for a long trade, or not TRIGGER_DEFAULT or TRIGGER_ASK for a short trade.
TakeProfitOnFillPriceDistanceMaximumExceeded
Filling the Order would result in the creation of a Take Profit Order whose price would be zero or negative due to the specified distance.
TrailingStopLossOnFillGtdTimestampInPast
Filling the Order would have resulted in the creation of a Trailing Stop Loss Order with a GTD time in the past.
ClientTradeIdAlreadyExists
Filling the Order would result in the creation of a new Open Trade with a client Trade ID already in use.
PositionCloseoutFailed
Closing out a position wasn’t fully possible.
OpenTradesAllowedExceeded
Filling the Order would cause the maximum open trades allowed for the Account to be exceeded.
PendingOrdersAllowedExceeded
Filling the Order would have resulted in exceeding the number of pending Orders allowed for the Account.
TakeProfitOnFillClientOrderIdAlreadyExists
Filling the Order would have resulted in the creation of a Take Profit Order with a client Order ID that is already in use.
StopLossOnFillClientOrderIdAlreadyExists
Filling the Order would have resulted in the creation of a Stop Loss Order with a client Order ID that is already in use.
GuaranteedStopLossOnFillClientOrderIdAlreadyExists
Filling the Order would have resulted in the creation of a Guaranteed Stop Loss Order with a client Order ID that is already in use.
TrailingStopLossOnFillClientOrderIdAlreadyExists
Filling the Order would have resulted in the creation of a Trailing Stop Loss Order with a client Order ID that is already in use.
PositionSizeExceeded
Filling the Order would have resulted in the Account’s maximum position size limit being exceeded for the Order’s instrument.
HedgingGsloViolation
Filling the Order would result in the creation of a Trade, however there already exists an opposing (hedged) Trade that has a guaranteed Stop Loss Order attached to it. Guaranteed Stop Loss Orders cannot be combined with hedged positions.
AccountPositionValueLimitExceeded
Filling the order would cause the maximum position value allowed for the account to be exceeded. The Order has been cancelled as a result.
InstrumentBidReduceOnly
Filling the order would require the creation of a short trade, however the instrument is configured such that orders being filled using bid prices can only reduce existing positions. New short positions cannot be created, but existing long positions may be reduced or closed.
InstrumentAskReduceOnly
Filling the order would require the creation of a long trade, however the instrument is configured such that orders being filled using ask prices can only reduce existing positions. New long positions cannot be created, but existing short positions may be reduced or closed.
InstrumentBidHalted
Filling the order would require using the bid, however the instrument is configured such that the bids are halted, and so no short orders may be filled.
InstrumentAskHalted
Filling the order would require using the ask, however the instrument is configured such that the asks are halted, and so no long orders may be filled.
StopLossOnFillGuaranteedBidHalted
Filling the Order would result in the creation of a Guaranteed Stop Loss Order (GSLO). Since the trade is long the GSLO would be short, however the bid side is currently halted. GSLOs cannot be created in this situation.
StopLossOnFillGuaranteedAskHalted
Filling the Order would result in the creation of a Guaranteed Stop Loss Order (GSLO). Since the trade is short the GSLO would be long, however the ask side is currently halted. GSLOs cannot be created in this situation.
GuaranteedStopLossOnFillBidHalted
Filling the Order would result in the creation of a Guaranteed Stop Loss Order (GSLO). Since the trade is long the GSLO would be short, however the bid side is currently halted. GSLOs cannot be created in this situation.
GuaranteedStopLossOnFillAskHalted
Filling the Order would result in the creation of a Guaranteed Stop Loss Order (GSLO). Since the trade is short the GSLO would be long, however the ask side is currently halted. GSLOs cannot be created in this situation.
FifoViolationSafeguardViolation
Filling the Order would have resulted in a new Trade that violates the FIFO violation safeguard constraints.
FifoViolationSafeguardPartialCloseViolation
Filling the Order would have reduced an existing Trade such that the reduced Trade violates the FIFO violation safeguard constraints.
OrdersOnFillRmoMutualExclusivityMutuallyExclusiveViolation
The Orders on fill would be in violation of the risk management Order mutual exclusivity configuration specifying that only one risk management Order can be attached to a Trade.
Unknown(String)
An unrecognized provider value, preserved for forward compatibility.