nautilus_model::orders::any

Enum OrderAny

Source
pub enum OrderAny {
    Limit(LimitOrder),
    LimitIfTouched(LimitIfTouchedOrder),
    Market(MarketOrder),
    MarketIfTouched(MarketIfTouchedOrder),
    MarketToLimit(MarketToLimitOrder),
    StopLimit(StopLimitOrder),
    StopMarket(StopMarketOrder),
    TrailingStopLimit(TrailingStopLimitOrder),
    TrailingStopMarket(TrailingStopMarketOrder),
}

Variants§

§

Limit(LimitOrder)

§

LimitIfTouched(LimitIfTouchedOrder)

§

Market(MarketOrder)

§

MarketIfTouched(MarketIfTouchedOrder)

§

MarketToLimit(MarketToLimitOrder)

§

StopLimit(StopLimitOrder)

§

StopMarket(StopMarketOrder)

§

TrailingStopLimit(TrailingStopLimitOrder)

§

TrailingStopMarket(TrailingStopMarketOrder)

Implementations§

Source§

impl OrderAny

Source

pub fn apply(&mut self, event: OrderEventAny) -> Result<(), OrderError>

Applies the given event to the order.

Source

pub fn from_limit(order: LimitOrder) -> Self

Source

pub fn from_limit_if_touched(order: LimitIfTouchedOrder) -> Self

Source

pub fn from_market(order: MarketOrder) -> Self

Source

pub fn from_market_if_touched(order: MarketIfTouchedOrder) -> Self

Source

pub fn from_market_to_limit(order: MarketToLimitOrder) -> Self

Source

pub fn from_stop_limit(order: StopLimitOrder) -> Self

Source

pub fn from_stop_market(order: StopMarketOrder) -> Self

Source

pub fn from_trailing_stop_limit(order: StopLimitOrder) -> Self

Source

pub fn from_trailing_stop_market(order: StopMarketOrder) -> Self

Source

pub fn from_events(events: Vec<OrderEventAny>) -> Result<Self>

Source

pub fn last_event(&self) -> &OrderEventAny

Source

pub fn trader_id(&self) -> TraderId

Source

pub fn strategy_id(&self) -> StrategyId

Source

pub fn instrument_id(&self) -> InstrumentId

Source

pub fn client_order_id(&self) -> ClientOrderId

Source

pub fn account_id(&self) -> Option<AccountId>

Source

pub fn venue_order_id(&self) -> Option<VenueOrderId>

Source

pub fn position_id(&self) -> Option<PositionId>

Source

pub fn exec_algorithm_id(&self) -> Option<ExecAlgorithmId>

Source

pub fn exec_spawn_id(&self) -> Option<ClientOrderId>

Source

pub fn order_side(&self) -> OrderSide

Source

pub fn order_type(&self) -> OrderType

Source

pub fn quantity(&self) -> Quantity

Source

pub fn status(&self) -> OrderStatus

Source

pub fn filled_qty(&self) -> Quantity

Source

pub fn leaves_qty(&self) -> Quantity

Source

pub fn order_side_specified(&self) -> OrderSideSpecified

Source

pub fn liquidity_side(&self) -> Option<LiquiditySide>

Source

pub fn emulation_trigger(&self) -> Option<TriggerType>

Source

pub fn is_open(&self) -> bool

Source

pub fn is_closed(&self) -> bool

Source

pub fn is_inflight(&self) -> bool

Source

pub fn price(&self) -> Option<Price>

Source

pub fn trigger_price(&self) -> Option<Price>

Source

pub fn would_reduce_only( &self, side: PositionSide, position_qty: Quantity, ) -> bool

Source

pub fn is_reduce_only(&self) -> bool

Source

pub fn is_buy(&self) -> bool

Source

pub fn is_sell(&self) -> bool

Source

pub fn parent_order_id(&self) -> Option<ClientOrderId>

Source

pub fn contingency_type(&self) -> Option<ContingencyType>

Source

pub fn linked_order_ids(&self) -> Option<Vec<ClientOrderId>>

Trait Implementations§

Source§

impl AsRef<StopMarketOrder> for OrderAny

Source§

fn as_ref(&self) -> &StopMarketOrder

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for OrderAny

Source§

fn clone(&self) -> OrderAny

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for OrderAny

Source§

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

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

impl Default for OrderAny

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for OrderAny

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

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

impl Display for OrderAny

Source§

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

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

impl From<OrderAny> for Box<dyn Order>

Source§

fn from(order: OrderAny) -> Box<dyn Order>

Converts to this type from the input type.
Source§

impl From<OrderAny> for LimitIfTouchedOrder

Source§

fn from(order: OrderAny) -> LimitIfTouchedOrder

Converts to this type from the input type.
Source§

impl From<OrderAny> for LimitOrder

Source§

fn from(order: OrderAny) -> LimitOrder

Converts to this type from the input type.
Source§

impl From<OrderAny> for LimitOrderAny

Source§

fn from(order: OrderAny) -> LimitOrderAny

Converts to this type from the input type.
Source§

impl From<OrderAny> for MarketIfTouchedOrder

Source§

fn from(order: OrderAny) -> MarketIfTouchedOrder

Converts to this type from the input type.
Source§

impl From<OrderAny> for MarketOrder

Source§

fn from(order: OrderAny) -> MarketOrder

Converts to this type from the input type.
Source§

impl From<OrderAny> for PassiveOrderAny

Source§

fn from(order: OrderAny) -> PassiveOrderAny

Converts to this type from the input type.
Source§

impl From<OrderAny> for StopLimitOrder

Source§

fn from(order: OrderAny) -> StopLimitOrder

Converts to this type from the input type.
Source§

impl From<OrderAny> for StopOrderAny

Source§

fn from(order: OrderAny) -> StopOrderAny

Converts to this type from the input type.
Source§

impl From<OrderAny> for TrailingStopLimitOrder

Source§

fn from(order: OrderAny) -> TrailingStopLimitOrder

Converts to this type from the input type.
Source§

impl From<OrderAny> for TrailingStopMarketOrder

Source§

fn from(order: OrderAny) -> TrailingStopMarketOrder

Converts to this type from the input type.
Source§

impl From<OrderInitialized> for OrderAny

Source§

fn from(order: OrderInitialized) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for OrderAny

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for OrderAny

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

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

impl Eq for OrderAny

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, dst: *mut u8)

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

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Separable for T
where T: Display,

Source§

fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String

Adds separators according to the given SeparatorPolicy. Read more
Source§

fn separate_with_commas(&self) -> String

Inserts a comma every three digits from the right. Read more
Source§

fn separate_with_spaces(&self) -> String

Inserts a space every three digits from the right. Read more
Source§

fn separate_with_dots(&self) -> String

Inserts a period every three digits from the right. Read more
Source§

fn separate_with_underscores(&self) -> String

Inserts an underscore every three digits from the right. 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> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Ungil for T
where T: Send,