pub struct StopMarketOrder {
pub trigger_price: Price,
pub trigger_type: TriggerType,
pub expire_time: Option<UnixNanos>,
pub display_qty: Option<Quantity>,
pub trigger_instrument_id: Option<InstrumentId>,
pub is_triggered: bool,
pub ts_triggered: Option<UnixNanos>,
/* private fields */
}
Fields§
§trigger_price: Price
§trigger_type: TriggerType
§expire_time: Option<UnixNanos>
§display_qty: Option<Quantity>
§trigger_instrument_id: Option<InstrumentId>
§is_triggered: bool
§ts_triggered: Option<UnixNanos>
Implementations§
Source§impl StopMarketOrder
impl StopMarketOrder
Sourcepub fn new(
trader_id: TraderId,
strategy_id: StrategyId,
instrument_id: InstrumentId,
client_order_id: ClientOrderId,
order_side: OrderSide,
quantity: Quantity,
trigger_price: Price,
trigger_type: TriggerType,
time_in_force: TimeInForce,
expire_time: Option<UnixNanos>,
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
pub fn new( trader_id: TraderId, strategy_id: StrategyId, instrument_id: InstrumentId, client_order_id: ClientOrderId, order_side: OrderSide, quantity: Quantity, trigger_price: Price, trigger_type: TriggerType, time_in_force: TimeInForce, expire_time: Option<UnixNanos>, 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 StopMarketOrder
instance.
Methods from Deref<Target = OrderCore>§
pub fn apply(&mut self, event: OrderEventAny) -> Result<(), OrderError>
pub fn set_slippage(&mut self, price: Price)
pub fn signed_decimal_qty(&self) -> Decimal
pub fn would_reduce_only( &self, side: PositionSide, position_qty: Quantity, ) -> bool
pub fn commission(&self, currency: &Currency) -> Option<Money>
pub fn commissions(&self) -> HashMap<Currency, Money>
pub fn init_event(&self) -> Option<OrderEventAny>
Trait Implementations§
Source§impl AsRef<StopMarketOrder> for OrderAny
impl AsRef<StopMarketOrder> for OrderAny
Source§fn as_ref(&self) -> &StopMarketOrder
fn as_ref(&self) -> &StopMarketOrder
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for StopMarketOrder
impl Clone for StopMarketOrder
Source§fn clone(&self) -> StopMarketOrder
fn clone(&self) -> StopMarketOrder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StopMarketOrder
impl Debug for StopMarketOrder
Source§impl Default for StopMarketOrder
impl Default for StopMarketOrder
Source§fn default() -> Self
fn default() -> Self
Creates a new default StopMarketOrder
instance for testing.
Source§impl Deref for StopMarketOrder
impl Deref for StopMarketOrder
Source§impl DerefMut for StopMarketOrder
impl DerefMut for StopMarketOrder
Source§impl<'de> Deserialize<'de> for StopMarketOrder
impl<'de> Deserialize<'de> for StopMarketOrder
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 From<OrderInitialized> for StopMarketOrder
impl From<OrderInitialized> for StopMarketOrder
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 StopMarketOrder
impl IntoPy<Py<PyAny>> for StopMarketOrder
Source§impl Order for StopMarketOrder
impl Order for StopMarketOrder
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 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 display_qty(&self) -> Option<Quantity>
fn limit_offset(&self) -> Option<Price>
fn trailing_offset(&self) -> Option<Price>
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<&HashMap<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_last(&self) -> UnixNanos
fn events(&self) -> Vec<&OrderEventAny>
fn venue_order_ids(&self) -> Vec<&VenueOrderId>
fn trade_ids(&self) -> Vec<&TradeId>
fn apply(&mut self, event: OrderEventAny) -> Result<(), OrderError>
fn update(&mut self, event: &OrderUpdated)
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
Source§impl PyClass for StopMarketOrder
impl PyClass for StopMarketOrder
Source§impl PyClassImpl for StopMarketOrder
impl PyClassImpl for StopMarketOrder
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<StopMarketOrder>
type ThreadChecker = SendablePyClass<StopMarketOrder>
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<StopMarketOrder> for PyClassImplCollector<StopMarketOrder>
impl PyClassNewTextSignature<StopMarketOrder> for PyClassImplCollector<StopMarketOrder>
fn new_text_signature(self) -> Option<&'static str>
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a StopMarketOrder
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a StopMarketOrder
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut StopMarketOrder
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut StopMarketOrder
Source§impl PyMethods<StopMarketOrder> for PyClassImplCollector<StopMarketOrder>
impl PyMethods<StopMarketOrder> for PyClassImplCollector<StopMarketOrder>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for StopMarketOrder
impl PyTypeInfo for StopMarketOrder
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_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
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_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
Checks if
object
is an instance of this type.Source§impl Serialize for StopMarketOrder
impl Serialize for StopMarketOrder
impl DerefToPyAny for StopMarketOrder
Auto Trait Implementations§
impl Freeze for StopMarketOrder
impl RefUnwindSafe for StopMarketOrder
impl Send for StopMarketOrder
impl Sync for StopMarketOrder
impl Unpin for StopMarketOrder
impl UnwindSafe for StopMarketOrder
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