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 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<'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

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 T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
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,