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
impl LimitIfTouchedOrder
Sourcepub fn new_checked(
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<IndexMap<Ustr, Ustr>>,
exec_spawn_id: Option<ClientOrderId>,
tags: Option<Vec<Ustr>>,
init_id: UUID4,
ts_init: UnixNanos,
) -> Result<Self>
pub fn new_checked( 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<IndexMap<Ustr, Ustr>>, exec_spawn_id: Option<ClientOrderId>, tags: Option<Vec<Ustr>>, init_id: UUID4, ts_init: UnixNanos, ) -> Result<Self>
Creates a new LimitIfTouchedOrder
instance.
§Errors
Returns an error if:
- The
quantity
is not positive. - The
display_qty
(when provided) exceedsquantity
. - The
time_in_force
is GTD and theexpire_time
isNone
or zero.
Sourcepub 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<IndexMap<Ustr, Ustr>>,
exec_spawn_id: Option<ClientOrderId>,
tags: Option<Vec<Ustr>>,
init_id: UUID4,
ts_init: UnixNanos,
) -> Self
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<IndexMap<Ustr, Ustr>>, exec_spawn_id: Option<ClientOrderId>, tags: Option<Vec<Ustr>>, init_id: UUID4, ts_init: UnixNanos, ) -> Self
Creates a new LimitIfTouchedOrder
instance.
§Panics
Panics if any order validation fails (see LimitIfTouchedOrder::new_checked
).
Methods from Deref<Target = OrderCore>§
Sourcepub fn apply(&mut self, event: OrderEventAny) -> Result<(), OrderError>
pub fn apply(&mut self, event: OrderEventAny) -> Result<(), OrderError>
pub fn set_slippage(&mut self, price: Price)
Sourcepub fn signed_decimal_qty(&self) -> Decimal
pub fn signed_decimal_qty(&self) -> Decimal
§Panics
Panics if the order side is neither Buy
nor Sell
.
pub fn would_reduce_only( &self, side: PositionSide, position_qty: Quantity, ) -> bool
pub fn commission(&self, currency: &Currency) -> Option<Money>
pub fn commissions(&self) -> IndexMap<Currency, Money>
pub fn commissions_vec(&self) -> Vec<Money>
pub fn init_event(&self) -> Option<OrderEventAny>
Trait Implementations§
Source§impl Clone for LimitIfTouchedOrder
impl Clone for LimitIfTouchedOrder
Source§fn clone(&self) -> LimitIfTouchedOrder
fn clone(&self) -> LimitIfTouchedOrder
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LimitIfTouchedOrder
impl Debug for LimitIfTouchedOrder
Source§impl Default for LimitIfTouchedOrder
impl Default for LimitIfTouchedOrder
Source§fn default() -> Self
fn default() -> Self
Creates a new default LimitIfTouchedOrder
instance for testing.
Source§impl Deref for LimitIfTouchedOrder
impl Deref for LimitIfTouchedOrder
Source§impl DerefMut for LimitIfTouchedOrder
impl DerefMut for LimitIfTouchedOrder
Source§impl<'de> Deserialize<'de> for LimitIfTouchedOrder
impl<'de> Deserialize<'de> for LimitIfTouchedOrder
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for LimitIfTouchedOrder
impl Display for LimitIfTouchedOrder
Source§impl From<LimitIfTouchedOrder> for OrderAny
impl From<LimitIfTouchedOrder> for OrderAny
Source§fn from(v: LimitIfTouchedOrder) -> OrderAny
fn from(v: LimitIfTouchedOrder) -> OrderAny
Converts to this type from the input type.
Source§impl From<LimitIfTouchedOrder> for StopOrderAny
impl From<LimitIfTouchedOrder> for StopOrderAny
Source§fn from(v: LimitIfTouchedOrder) -> StopOrderAny
fn from(v: LimitIfTouchedOrder) -> StopOrderAny
Converts to this type from the input type.
Source§impl From<OrderInitialized> for LimitIfTouchedOrder
impl From<OrderInitialized> for LimitIfTouchedOrder
Source§fn from(event: OrderInitialized) -> Self
fn from(event: OrderInitialized) -> Self
Converts to this type from the input type.
Source§impl IntoPy<Py<PyAny>> for LimitIfTouchedOrder
impl IntoPy<Py<PyAny>> for LimitIfTouchedOrder
Source§impl<'py> IntoPyObject<'py> for LimitIfTouchedOrder
impl<'py> IntoPyObject<'py> for LimitIfTouchedOrder
Source§type Target = LimitIfTouchedOrder
type Target = LimitIfTouchedOrder
The Python output type
Source§type Output = Bound<'py, <LimitIfTouchedOrder as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <LimitIfTouchedOrder as IntoPyObject<'py>>::Target>
The smart pointer type to use. Read more
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Performs the conversion.
Source§impl Order for LimitIfTouchedOrder
impl Order for LimitIfTouchedOrder
fn into_any(self) -> OrderAny
fn status(&self) -> OrderStatus
fn trader_id(&self) -> TraderId
fn strategy_id(&self) -> StrategyId
fn instrument_id(&self) -> InstrumentId
fn symbol(&self) -> Symbol
fn venue(&self) -> Venue
fn client_order_id(&self) -> ClientOrderId
fn venue_order_id(&self) -> Option<VenueOrderId>
fn position_id(&self) -> Option<PositionId>
fn account_id(&self) -> Option<AccountId>
fn last_trade_id(&self) -> Option<TradeId>
fn order_side(&self) -> OrderSide
fn order_type(&self) -> OrderType
fn quantity(&self) -> Quantity
fn time_in_force(&self) -> TimeInForce
fn expire_time(&self) -> Option<UnixNanos>
fn price(&self) -> Option<Price>
fn trigger_price(&self) -> Option<Price>
fn trigger_type(&self) -> Option<TriggerType>
fn liquidity_side(&self) -> Option<LiquiditySide>
fn is_post_only(&self) -> bool
fn is_reduce_only(&self) -> bool
fn is_quote_quantity(&self) -> bool
fn has_price(&self) -> bool
fn display_qty(&self) -> Option<Quantity>
fn limit_offset(&self) -> Option<Decimal>
fn trailing_offset(&self) -> Option<Decimal>
fn trailing_offset_type(&self) -> Option<TrailingOffsetType>
fn emulation_trigger(&self) -> Option<TriggerType>
fn trigger_instrument_id(&self) -> Option<InstrumentId>
fn contingency_type(&self) -> Option<ContingencyType>
fn order_list_id(&self) -> Option<OrderListId>
fn linked_order_ids(&self) -> Option<&[ClientOrderId]>
fn parent_order_id(&self) -> Option<ClientOrderId>
fn exec_algorithm_id(&self) -> Option<ExecAlgorithmId>
fn exec_algorithm_params(&self) -> Option<&IndexMap<Ustr, Ustr>>
fn exec_spawn_id(&self) -> Option<ClientOrderId>
fn filled_qty(&self) -> Quantity
fn leaves_qty(&self) -> Quantity
fn avg_px(&self) -> Option<f64>
fn slippage(&self) -> Option<f64>
fn init_id(&self) -> UUID4
fn ts_init(&self) -> UnixNanos
fn ts_submitted(&self) -> Option<UnixNanos>
fn ts_accepted(&self) -> Option<UnixNanos>
fn ts_closed(&self) -> Option<UnixNanos>
fn ts_last(&self) -> UnixNanos
fn commissions(&self) -> &IndexMap<Currency, Money>
fn events(&self) -> Vec<&OrderEventAny>
fn venue_order_ids(&self) -> Vec<&VenueOrderId>
fn trade_ids(&self) -> Vec<&TradeId>
Source§fn apply(&mut self, event: OrderEventAny) -> Result<(), OrderError>
fn apply(&mut self, event: OrderEventAny) -> Result<(), OrderError>
Applies the
event
to the order. Read morefn update(&mut self, event: &OrderUpdated)
fn is_triggered(&self) -> Option<bool>
fn set_position_id(&mut self, position_id: Option<PositionId>)
fn set_quantity(&mut self, quantity: Quantity)
fn set_leaves_qty(&mut self, leaves_qty: Quantity)
fn set_emulation_trigger(&mut self, emulation_trigger: Option<TriggerType>)
fn set_is_quote_quantity(&mut self, is_quote_quantity: bool)
fn set_liquidity_side(&mut self, liquidity_side: LiquiditySide)
fn would_reduce_only(&self, side: PositionSide, position_qty: Quantity) -> bool
fn previous_status(&self) -> Option<OrderStatus>
fn order_side_specified(&self) -> OrderSideSpecified
fn last_event(&self) -> &OrderEventAny
fn event_count(&self) -> usize
fn is_buy(&self) -> bool
fn is_sell(&self) -> bool
fn is_passive(&self) -> bool
fn is_aggressive(&self) -> bool
fn is_emulated(&self) -> bool
fn is_active_local(&self) -> bool
fn is_primary(&self) -> bool
fn is_secondary(&self) -> bool
fn is_contingency(&self) -> bool
fn is_parent_order(&self) -> bool
fn is_child_order(&self) -> bool
fn is_open(&self) -> bool
fn is_canceled(&self) -> bool
fn is_closed(&self) -> bool
fn is_inflight(&self) -> bool
fn is_pending_update(&self) -> bool
fn is_pending_cancel(&self) -> bool
fn is_spawned(&self) -> bool
fn to_own_book_order(&self) -> OwnBookOrder
Source§impl PyClass for LimitIfTouchedOrder
impl PyClass for LimitIfTouchedOrder
Source§impl PyClassImpl for LimitIfTouchedOrder
impl PyClassImpl for LimitIfTouchedOrder
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
Source§type ThreadChecker = SendablePyClass<LimitIfTouchedOrder>
type ThreadChecker = SendablePyClass<LimitIfTouchedOrder>
This handles following two situations: Read more
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature<LimitIfTouchedOrder> for PyClassImplCollector<LimitIfTouchedOrder>
impl PyClassNewTextSignature<LimitIfTouchedOrder> for PyClassImplCollector<LimitIfTouchedOrder>
fn new_text_signature(self) -> Option<&'static str>
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a LimitIfTouchedOrder
impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a LimitIfTouchedOrder
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut LimitIfTouchedOrder
impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut LimitIfTouchedOrder
Source§impl PyMethods<LimitIfTouchedOrder> for PyClassImplCollector<LimitIfTouchedOrder>
impl PyMethods<LimitIfTouchedOrder> for PyClassImplCollector<LimitIfTouchedOrder>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for LimitIfTouchedOrder
impl PyTypeInfo for LimitIfTouchedOrder
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
👎Deprecated since 0.23.0: renamed to
PyTypeInfo::type_object
Deprecated name for [
PyTypeInfo::type_object
].§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
Checks if
object
is an instance of this type or a subclass of this type.§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
👎Deprecated since 0.23.0: renamed to
PyTypeInfo::is_type_of
Deprecated name for [
PyTypeInfo::is_type_of
].§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
Checks if
object
is an instance of this type.§fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
👎Deprecated since 0.23.0: renamed to
PyTypeInfo::is_exact_type_of
Deprecated name for [
PyTypeInfo::is_exact_type_of
].Source§impl Serialize for LimitIfTouchedOrder
impl Serialize for LimitIfTouchedOrder
Source§impl TryInto<LimitIfTouchedOrder> for OrderAny
impl TryInto<LimitIfTouchedOrder> for OrderAny
Source§impl TryInto<LimitIfTouchedOrder> for StopOrderAny
impl TryInto<LimitIfTouchedOrder> for StopOrderAny
impl DerefToPyAny for LimitIfTouchedOrder
Auto Trait Implementations§
impl Freeze for LimitIfTouchedOrder
impl RefUnwindSafe for LimitIfTouchedOrder
impl Send for LimitIfTouchedOrder
impl Sync for LimitIfTouchedOrder
impl Unpin for LimitIfTouchedOrder
impl UnwindSafe for LimitIfTouchedOrder
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
impl<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
§fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
§fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§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>
Converts
self
into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
Converts
self
into an owned Python object, dropping type information and unbinding it
from the 'py
lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
Converts
self
into a Python object. Read moreSource§impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>
§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
Source§impl<T> Separable for Twhere
T: Display,
impl<T> Separable for Twhere
T: Display,
Source§fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
Adds separators according to the given
SeparatorPolicy
. Read moreSource§fn separate_with_commas(&self) -> String
fn separate_with_commas(&self) -> String
Inserts a comma every three digits from the right. Read more
Source§fn separate_with_spaces(&self) -> String
fn separate_with_spaces(&self) -> String
Inserts a space every three digits from the right. Read more
Source§fn separate_with_dots(&self) -> String
fn separate_with_dots(&self) -> String
Inserts a period every three digits from the right. Read more
Source§fn separate_with_underscores(&self) -> String
fn separate_with_underscores(&self) -> String
Inserts an underscore every three digits from the right. Read more