#[repr(C)]pub enum OrderStatus {
Show 14 variants
Initialized = 1,
Denied = 2,
Emulated = 3,
Released = 4,
Submitted = 5,
Accepted = 6,
Rejected = 7,
Canceled = 8,
Expired = 9,
Triggered = 10,
PendingUpdate = 11,
PendingCancel = 12,
PartiallyFilled = 13,
Filled = 14,
}Expand description
The status for a specific order.
An order is considered open for the following status:
ACCEPTEDTRIGGEREDPENDING_UPDATEPENDING_CANCELPARTIALLY_FILLED
An order is considered in-flight for the following status:
SUBMITTEDPENDING_UPDATEPENDING_CANCEL
An order is considered closed for the following status:
DENIEDREJECTEDCANCELEDEXPIREDFILLED
Variants§
Initialized = 1
The order is initialized (instantiated) within the Nautilus system.
Denied = 2
The order was denied by the Nautilus system, either for being invalid, unprocessable or exceeding a risk limit.
Emulated = 3
The order became emulated by the Nautilus system in the OrderEmulator component.
Released = 4
The order was released by the Nautilus system from the OrderEmulator component.
Submitted = 5
The order was submitted by the Nautilus system to the external service or trading venue (awaiting acknowledgement).
Accepted = 6
The order was acknowledged by the trading venue as being received and valid (may now be working).
Rejected = 7
The order was rejected by the trading venue.
Canceled = 8
The order was canceled (closed/done).
Expired = 9
The order reached a GTD expiration (closed/done).
Triggered = 10
The order STOP price was triggered on a trading venue.
PendingUpdate = 11
The order is currently pending a request to modify on a trading venue.
PendingCancel = 12
The order is currently pending a request to cancel on a trading venue.
PartiallyFilled = 13
The order has been partially filled on a trading venue.
Filled = 14
The order has been completely filled on a trading venue (closed/done).
Implementations§
Source§impl OrderStatus
impl OrderStatus
Source§impl OrderStatus
impl OrderStatus
Sourcepub const fn is_open(self) -> bool
pub const fn is_open(self) -> bool
Returns whether the order status represents an open/working order.
Sourcepub const fn is_closed(self) -> bool
pub const fn is_closed(self) -> bool
Returns whether the order status represents a terminal (closed) state.
Sourcepub const fn is_cancellable(self) -> bool
pub const fn is_cancellable(self) -> bool
Returns whether the order can be cancelled from this status.
Sourcepub fn cancellable_statuses_set() -> &'static AHashSet<Self>
pub fn cancellable_statuses_set() -> &'static AHashSet<Self>
Returns a cached AHashSet of order statuses safe for cancellation queries.
These are statuses where an order is working on the venue but not already
in the process of being cancelled or updated. Including PENDING_CANCEL
in cancellation filters can cause duplicate cancel attempts or incorrect open order counts.
Returns:
ACCEPTED: Order is working on the venue.TRIGGERED: Stop order has been triggered.PENDING_UPDATE: Order being updated.PARTIALLY_FILLED: Order is partially filled but still working.
Excludes:
PENDING_CANCEL: Already being cancelled.
Source§impl OrderStatus
impl OrderStatus
Sourcepub fn transition(&mut self, event: &OrderEventAny) -> Result<Self, OrderError>
pub fn transition(&mut self, event: &OrderEventAny) -> Result<Self, OrderError>
Transitions the order state machine based on the given event.
§Errors
Returns an error if the state transition is invalid from the current status.
Trait Implementations§
Source§impl AsRef<str> for OrderStatus
impl AsRef<str> for OrderStatus
Source§impl Clone for OrderStatus
impl Clone for OrderStatus
Source§fn clone(&self) -> OrderStatus
fn clone(&self) -> OrderStatus
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OrderStatus
impl Debug for OrderStatus
Source§impl<'de> Deserialize<'de> for OrderStatus
impl<'de> Deserialize<'de> for OrderStatus
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl Display for OrderStatus
impl Display for OrderStatus
Source§impl<'a, 'py> FromPyObject<'a, 'py> for OrderStatuswhere
Self: Clone,
impl<'a, 'py> FromPyObject<'a, 'py> for OrderStatuswhere
Self: Clone,
Source§impl FromStr for OrderStatus
impl FromStr for OrderStatus
Source§impl Hash for OrderStatus
impl Hash for OrderStatus
Source§impl IntoEnumIterator for OrderStatus
impl IntoEnumIterator for OrderStatus
type Iterator = OrderStatusIter
fn iter() -> OrderStatusIter ⓘ
Source§impl<'py> IntoPyObject<'py> for OrderStatus
impl<'py> IntoPyObject<'py> for OrderStatus
Source§type Target = OrderStatus
type Target = OrderStatus
Source§type Output = Bound<'py, <OrderStatus as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <OrderStatus as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'py>>::Output, <Self as IntoPyObject<'py>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'py>>::Output, <Self as IntoPyObject<'py>>::Error>
Source§impl Ord for OrderStatus
impl Ord for OrderStatus
Source§fn cmp(&self, other: &OrderStatus) -> Ordering
fn cmp(&self, other: &OrderStatus) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for OrderStatus
impl PartialEq for OrderStatus
Source§impl PartialOrd for OrderStatus
impl PartialOrd for OrderStatus
Source§impl PyClass for OrderStatus
impl PyClass for OrderStatus
Source§impl PyClassImpl for OrderStatus
impl PyClassImpl for OrderStatus
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// The status for a specific order.
///
/// An order is considered _open_ for the following status:
/// - `ACCEPTED`
/// - `TRIGGERED`
/// - `PENDING_UPDATE`
/// - `PENDING_CANCEL`
/// - `PARTIALLY_FILLED`
///
/// An order is considered _in-flight_ for the following status:
/// - `SUBMITTED`
/// - `PENDING_UPDATE`
/// - `PENDING_CANCEL`
///
/// An order is considered _closed_ for the following status:
/// - `DENIED`
/// - `REJECTED`
/// - `CANCELED`
/// - `EXPIRED`
/// - `FILLED`
const RAW_DOC: &'static CStr = /// The status for a specific order. /// /// An order is considered _open_ for the following status: /// - `ACCEPTED` /// - `TRIGGERED` /// - `PENDING_UPDATE` /// - `PENDING_CANCEL` /// - `PARTIALLY_FILLED` /// /// An order is considered _in-flight_ for the following status: /// - `SUBMITTED` /// - `PENDING_UPDATE` /// - `PENDING_CANCEL` /// /// An order is considered _closed_ for the following status: /// - `DENIED` /// - `REJECTED` /// - `CANCELED` /// - `EXPIRED` /// - `FILLED`
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type Layout = <<OrderStatus as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<OrderStatus>
type Layout = <<OrderStatus as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<OrderStatus>
Source§type ThreadChecker = NoopThreadChecker
type ThreadChecker = NoopThreadChecker
type Inventory = Pyo3MethodsInventoryForOrderStatus
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
Source§fn dict_offset() -> Option<PyObjectOffset>
fn dict_offset() -> Option<PyObjectOffset>
Source§fn weaklist_offset() -> Option<PyObjectOffset>
fn weaklist_offset() -> Option<PyObjectOffset>
Source§impl PyClassNewTextSignature for OrderStatus
impl PyClassNewTextSignature for OrderStatus
const TEXT_SIGNATURE: &'static str = "(value)"
Source§impl PyStubType for OrderStatus
impl PyStubType for OrderStatus
Source§fn type_output() -> TypeInfo
fn type_output() -> TypeInfo
Source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
Source§impl PyTypeInfo for OrderStatus
impl PyTypeInfo for OrderStatus
Source§const NAME: &str = <Self as ::pyo3::PyClass>::NAME
const NAME: &str = <Self as ::pyo3::PyClass>::NAME
prefer using ::type_object(py).name() to get the correct runtime value
Source§const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
prefer using ::type_object(py).module() to get the correct runtime value
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Source§impl Serialize for OrderStatus
impl Serialize for OrderStatus
Source§impl TryFrom<&str> for OrderStatus
impl TryFrom<&str> for OrderStatus
impl Copy for OrderStatus
impl Eq for OrderStatus
impl StructuralPartialEq for OrderStatus
Auto Trait Implementations§
impl Freeze for OrderStatus
impl RefUnwindSafe for OrderStatus
impl Send for OrderStatus
impl Sync for OrderStatus
impl Unpin for OrderStatus
impl UnsafeUnpin for OrderStatus
impl UnwindSafe for OrderStatus
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.Source§impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
Source§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
Source§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
Source§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
Use ::classinfo_object() instead and format the type name at runtime. Note that using built-in cast features is often better than manual PyTypeCheck usage.