nautilus_model::orders::limit_if_touched

Struct LimitIfTouchedOrder

source
pub struct LimitIfTouchedOrder {
    pub price: Price,
    pub trigger_price: Price,
    pub trigger_type: TriggerType,
    pub expire_time: Option<UnixNanos>,
    pub is_post_only: bool,
    pub display_qty: Option<Quantity>,
    pub trigger_instrument_id: Option<InstrumentId>,
    pub is_triggered: bool,
    pub ts_triggered: Option<UnixNanos>,
    /* private fields */
}

Fields§

§price: Price§trigger_price: Price§trigger_type: TriggerType§expire_time: Option<UnixNanos>§is_post_only: bool§display_qty: Option<Quantity>§trigger_instrument_id: Option<InstrumentId>§is_triggered: bool§ts_triggered: Option<UnixNanos>

Implementations§

source§

impl LimitIfTouchedOrder

source

pub fn new( trader_id: TraderId, strategy_id: StrategyId, instrument_id: InstrumentId, client_order_id: ClientOrderId, order_side: OrderSide, quantity: Quantity, price: Price, trigger_price: Price, trigger_type: TriggerType, time_in_force: TimeInForce, expire_time: Option<UnixNanos>, post_only: bool, reduce_only: bool, quote_quantity: bool, display_qty: Option<Quantity>, emulation_trigger: Option<TriggerType>, trigger_instrument_id: Option<InstrumentId>, contingency_type: Option<ContingencyType>, order_list_id: Option<OrderListId>, linked_order_ids: Option<Vec<ClientOrderId>>, parent_order_id: Option<ClientOrderId>, exec_algorithm_id: Option<ExecAlgorithmId>, exec_algorithm_params: Option<HashMap<Ustr, Ustr>>, exec_spawn_id: Option<ClientOrderId>, tags: Option<Vec<Ustr>>, init_id: UUID4, ts_init: UnixNanos, ) -> Self

Creates a new LimitIfTouchedOrder instance.

Methods from Deref<Target = OrderCore>§

source

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

source

pub fn set_slippage(&mut self, price: Price)

source

pub fn signed_decimal_qty(&self) -> Decimal

source

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

source

pub fn commission(&self, currency: &Currency) -> Option<Money>

source

pub fn commissions(&self) -> HashMap<Currency, Money>

source

pub fn init_event(&self) -> Option<OrderEventAny>

Trait Implementations§

source§

impl Clone for LimitIfTouchedOrder

source§

fn clone(&self) -> LimitIfTouchedOrder

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 LimitIfTouchedOrder

source§

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

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

impl Default for LimitIfTouchedOrder

source§

fn default() -> Self

Creates a new default LimitIfTouchedOrder instance for testing.

source§

impl Deref for LimitIfTouchedOrder

source§

type Target = OrderCore

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for LimitIfTouchedOrder

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<'de> Deserialize<'de> for LimitIfTouchedOrder

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 From<OrderAny> for LimitIfTouchedOrder

source§

fn from(order: OrderAny) -> LimitIfTouchedOrder

Converts to this type from the input type.
source§

impl From<OrderInitialized> for LimitIfTouchedOrder

source§

fn from(event: OrderInitialized) -> Self

Converts to this type from the input type.
source§

impl HasPyGilRef for LimitIfTouchedOrder

source§

type AsRefTarget = PyCell<LimitIfTouchedOrder>

Utility type to make Py::as_ref work.
source§

impl IntoPy<Py<PyAny>> for LimitIfTouchedOrder

source§

fn into_py(self, py: Python<'_>) -> PyObject

Performs the conversion.
source§

impl Order for LimitIfTouchedOrder

source§

fn into_any(self) -> OrderAny

source§

fn status(&self) -> OrderStatus

source§

fn trader_id(&self) -> TraderId

source§

fn strategy_id(&self) -> StrategyId

source§

fn instrument_id(&self) -> InstrumentId

source§

fn symbol(&self) -> Symbol

source§

fn venue(&self) -> Venue

source§

fn client_order_id(&self) -> ClientOrderId

source§

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

source§

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

source§

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

source§

fn last_trade_id(&self) -> Option<TradeId>

source§

fn side(&self) -> OrderSide

source§

fn order_type(&self) -> OrderType

source§

fn quantity(&self) -> Quantity

source§

fn time_in_force(&self) -> TimeInForce

source§

fn expire_time(&self) -> Option<UnixNanos>

source§

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

source§

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

source§

fn trigger_type(&self) -> Option<TriggerType>

source§

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

source§

fn is_post_only(&self) -> bool

source§

fn is_reduce_only(&self) -> bool

source§

fn is_quote_quantity(&self) -> bool

source§

fn display_qty(&self) -> Option<Quantity>

source§

fn limit_offset(&self) -> Option<Price>

source§

fn trailing_offset(&self) -> Option<Price>

source§

fn trailing_offset_type(&self) -> Option<TrailingOffsetType>

source§

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

source§

fn trigger_instrument_id(&self) -> Option<InstrumentId>

source§

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

source§

fn order_list_id(&self) -> Option<OrderListId>

source§

fn linked_order_ids(&self) -> Option<&[ClientOrderId]>

source§

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

source§

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

source§

fn exec_algorithm_params(&self) -> Option<&HashMap<Ustr, Ustr>>

source§

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

source§

fn tags(&self) -> Option<&[Ustr]>

source§

fn filled_qty(&self) -> Quantity

source§

fn leaves_qty(&self) -> Quantity

source§

fn avg_px(&self) -> Option<f64>

source§

fn slippage(&self) -> Option<f64>

source§

fn init_id(&self) -> UUID4

source§

fn ts_init(&self) -> UnixNanos

source§

fn ts_last(&self) -> UnixNanos

source§

fn events(&self) -> Vec<&OrderEventAny>

source§

fn venue_order_ids(&self) -> Vec<&VenueOrderId>

source§

fn trade_ids(&self) -> Vec<&TradeId>

source§

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

source§

fn update(&mut self, event: &OrderUpdated)

source§

fn last_event(&self) -> &OrderEventAny

source§

fn event_count(&self) -> usize

source§

fn is_buy(&self) -> bool

source§

fn is_sell(&self) -> bool

source§

fn is_passive(&self) -> bool

source§

fn is_aggressive(&self) -> bool

source§

fn is_emulated(&self) -> bool

source§

fn is_active_local(&self) -> bool

source§

fn is_primary(&self) -> bool

source§

fn is_secondary(&self) -> bool

source§

fn is_contingency(&self) -> bool

source§

fn is_parent_order(&self) -> bool

source§

fn is_child_order(&self) -> bool

source§

fn is_open(&self) -> bool

source§

fn is_canceled(&self) -> bool

source§

fn is_closed(&self) -> bool

source§

fn is_inflight(&self) -> bool

source§

fn is_pending_update(&self) -> bool

source§

fn is_pending_cancel(&self) -> bool

source§

fn is_spawned(&self) -> bool

source§

impl PyClass for LimitIfTouchedOrder

source§

type Frozen = False

Whether the pyclass is frozen. Read more
source§

impl PyClassImpl for LimitIfTouchedOrder

source§

const IS_BASETYPE: bool = false

#[pyclass(subclass)]
source§

const IS_SUBCLASS: bool = false

#[pyclass(extends=…)]
source§

const IS_MAPPING: bool = false

#[pyclass(mapping)]
source§

const IS_SEQUENCE: bool = false

#[pyclass(sequence)]
source§

type BaseType = PyAny

Base class
source§

type ThreadChecker = SendablePyClass<LimitIfTouchedOrder>

This handles following two situations: Read more
source§

type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild

Immutable or mutable
source§

type Dict = PyClassDummySlot

Specify this class has #[pyclass(dict)] or not.
source§

type WeakRef = PyClassDummySlot

Specify this class has #[pyclass(weakref)] or not.
source§

type BaseNativeType = PyAny

The closest native ancestor. This is PyAny by default, and when you declare #[pyclass(extends=PyDict)], it’s PyDict.
source§

fn items_iter() -> PyClassItemsIter

source§

fn doc(py: Python<'_>) -> PyResult<&'static CStr>

Rendered class doc
source§

fn lazy_type_object() -> &'static LazyTypeObject<Self>

§

fn dict_offset() -> Option<isize>

§

fn weaklist_offset() -> Option<isize>

source§

impl PyClassNewTextSignature<LimitIfTouchedOrder> for PyClassImplCollector<LimitIfTouchedOrder>

source§

fn new_text_signature(self) -> Option<&'static str>

source§

impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a LimitIfTouchedOrder

source§

type Holder = Option<PyRef<'py, LimitIfTouchedOrder>>

source§

fn extract( obj: &'a Bound<'py, PyAny>, holder: &'a mut Self::Holder, ) -> PyResult<Self>

source§

impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut LimitIfTouchedOrder

source§

type Holder = Option<PyRefMut<'py, LimitIfTouchedOrder>>

source§

fn extract( obj: &'a Bound<'py, PyAny>, holder: &'a mut Self::Holder, ) -> PyResult<Self>

source§

impl PyMethods<LimitIfTouchedOrder> for PyClassImplCollector<LimitIfTouchedOrder>

source§

fn py_methods(self) -> &'static PyClassItems

source§

impl PyTypeInfo for LimitIfTouchedOrder

source§

const NAME: &'static str = "LimitIfTouchedOrder"

Class name.
source§

const MODULE: Option<&'static str> = _

Module name, if any.
source§

fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject

Returns the PyTypeObject instance for this type.
§

fn type_object(py: Python<'_>) -> &PyType

👎Deprecated since 0.21.0: PyTypeInfo::type_object will be replaced by PyTypeInfo::type_object_bound in a future PyO3 version
Returns the safe abstraction over the type object.
§

fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>

Returns the safe abstraction over the type object.
§

fn is_type_of(object: &PyAny) -> bool

👎Deprecated since 0.21.0: PyTypeInfo::is_type_of will be replaced by PyTypeInfo::is_type_of_bound in a future PyO3 version
Checks if object is an instance of this type or a subclass of this type.
§

fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type or a subclass of this type.
§

fn is_exact_type_of(object: &PyAny) -> bool

👎Deprecated since 0.21.0: PyTypeInfo::is_exact_type_of will be replaced by PyTypeInfo::is_exact_type_of_bound in a future PyO3 version
Checks if object is an instance of this type.
§

fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type.
source§

impl Serialize for LimitIfTouchedOrder

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 DerefToPyAny for LimitIfTouchedOrder

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.

§

impl<T> FromPyObject<'_> for T
where T: PyClass + Clone,

§

fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>

Extracts Self from the bound smart pointer obj. Read more
§

fn extract(ob: &'py PyAny) -> Result<Self, PyErr>

Extracts Self from the source GIL Ref obj. Read more
§

impl<'py, T> FromPyObjectBound<'_, 'py> for T
where T: FromPyObject<'py>,

§

fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>

Extracts Self from the bound smart pointer obj. 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.

§

impl<T> PyErrArguments for T
where T: IntoPy<Py<PyAny>> + Send + Sync,

§

fn arguments(self, py: Python<'_>) -> Py<PyAny>

Arguments for exception
§

impl<T> PyTypeCheck for T
where T: PyTypeInfo,

§

const NAME: &'static str = <T as PyTypeInfo>::NAME

Name of self. This is used in error messages, for example.
§

fn type_check(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of Self, which may include a subtype. 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 = 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,