Skip to main content

OrderCancelReason

Enum OrderCancelReason 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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.

Implementations§

Source§

impl OrderCancelReason

Source

pub fn as_str(&self) -> &str

Return the exact provider spelling.

Trait Implementations§

Source§

impl Clone for OrderCancelReason

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OrderCancelReason

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for OrderCancelReason

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for OrderCancelReason

Source§

impl Hash for OrderCancelReason

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for OrderCancelReason

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for OrderCancelReason

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for OrderCancelReason

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more