diff --git a/nautilus_core/core/src/nanos.rs b/nautilus_core/core/src/nanos.rs index 7896824ec31e..f4ec4ba423f6 100644 --- a/nautilus_core/core/src/nanos.rs +++ b/nautilus_core/core/src/nanos.rs @@ -17,6 +17,7 @@ use std::{ cmp::Ordering, fmt::Display, ops::{Add, AddAssign, Deref, MulAssign, Sub, SubAssign}, + str::FromStr, }; use serde::{Deserialize, Serialize}; @@ -76,6 +77,20 @@ impl From for UnixNanos { } } +impl From<&str> for UnixNanos { + fn from(value: &str) -> Self { + UnixNanos(value.parse().unwrap()) + } +} + +impl FromStr for UnixNanos { + type Err = std::num::ParseIntError; + + fn from_str(s: &str) -> Result { + s.parse().map(UnixNanos) + } +} + // impl Into for UnixNanos { // fn into(self) -> u64 { // self.0 diff --git a/nautilus_core/model/src/python/orders/limit_if_touched.rs b/nautilus_core/model/src/python/orders/limit_if_touched.rs new file mode 100644 index 000000000000..02459a1e2821 --- /dev/null +++ b/nautilus_core/model/src/python/orders/limit_if_touched.rs @@ -0,0 +1,98 @@ +// ------------------------------------------------------------------------------------------------- +// Copyright (C) 2015-2024 Nautech Systems Pty Ltd. All rights reserved. +// https://nautechsystems.io +// +// Licensed under the GNU Lesser General Public License Version 3.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------------------------------- + +use std::collections::HashMap; + +use nautilus_core::uuid::UUID4; +use pyo3::prelude::*; +use ustr::Ustr; + +use crate::{ + enums::{ContingencyType, OrderSide, TimeInForce, TriggerType}, + identifiers::{ + client_order_id::ClientOrderId, exec_algorithm_id::ExecAlgorithmId, + instrument_id::InstrumentId, order_list_id::OrderListId, strategy_id::StrategyId, + trader_id::TraderId, + }, + orders::{base::str_hashmap_to_ustr, limit_if_touched::LimitIfTouchedOrder}, + types::{price::Price, quantity::Quantity}, +}; + +#[pymethods] +impl LimitIfTouchedOrder { + #[new] + #[allow(clippy::too_many_arguments)] + fn py_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, + post_only: bool, + reduce_only: bool, + quote_quantity: bool, + init_id: UUID4, + ts_init: u64, + expire_time: Option, + display_qty: Option, + emulation_trigger: Option, + trigger_instrument_id: Option, + contingency_type: Option, + order_list_id: Option, + linked_order_ids: Option>, + parent_order_id: Option, + exec_algorithm_id: Option, + exec_algorithm_params: Option>, + exec_spawn_id: Option, + tags: Option, + ) -> PyResult { + let exec_algorithm_params = exec_algorithm_params.map(str_hashmap_to_ustr); + Ok(Self::new( + trader_id, + strategy_id, + instrument_id, + client_order_id, + order_side, + quantity, + price, + trigger_price, + trigger_type, + time_in_force, + expire_time.map(|x| x.into()), + post_only, + reduce_only, + quote_quantity, + display_qty, + emulation_trigger, + trigger_instrument_id, + contingency_type, + order_list_id, + linked_order_ids, + parent_order_id, + exec_algorithm_id, + exec_algorithm_params, + exec_spawn_id, + tags.map(|s| Ustr::from(&s)), + init_id, + ts_init.into(), + ) + .unwrap()) + } +} diff --git a/nautilus_core/model/src/python/orders/market.rs b/nautilus_core/model/src/python/orders/market.rs index ce8b1af184ba..f74a8ad53d68 100644 --- a/nautilus_core/model/src/python/orders/market.rs +++ b/nautilus_core/model/src/python/orders/market.rs @@ -64,6 +64,7 @@ impl MarketOrder { exec_spawn_id: Option, tags: Option, ) -> PyResult { + let exec_algorithm_params = exec_algorithm_params.map(str_hashmap_to_ustr); Self::new( trader_id, strategy_id, @@ -81,7 +82,7 @@ impl MarketOrder { linked_order_ids, parent_order_id, exec_algorithm_id, - exec_algorithm_params.map(str_hashmap_to_ustr), + exec_algorithm_params, exec_spawn_id, tags.map(|s| Ustr::from(&s)), ) diff --git a/nautilus_core/model/src/python/orders/market_if_touched.rs b/nautilus_core/model/src/python/orders/market_if_touched.rs new file mode 100644 index 000000000000..0f638dedd8a0 --- /dev/null +++ b/nautilus_core/model/src/python/orders/market_if_touched.rs @@ -0,0 +1,94 @@ +// ------------------------------------------------------------------------------------------------- +// Copyright (C) 2015-2024 Nautech Systems Pty Ltd. All rights reserved. +// https://nautechsystems.io +// +// Licensed under the GNU Lesser General Public License Version 3.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------------------------------- + +use std::collections::HashMap; + +use nautilus_core::uuid::UUID4; +use pyo3::prelude::*; +use ustr::Ustr; + +use crate::{ + enums::{ContingencyType, OrderSide, TimeInForce, TriggerType}, + identifiers::{ + client_order_id::ClientOrderId, exec_algorithm_id::ExecAlgorithmId, + instrument_id::InstrumentId, order_list_id::OrderListId, strategy_id::StrategyId, + trader_id::TraderId, + }, + orders::{base::str_hashmap_to_ustr, market_if_touched::MarketIfTouchedOrder}, + types::{price::Price, quantity::Quantity}, +}; + +#[pymethods] +impl MarketIfTouchedOrder { + #[new] + #[allow(clippy::too_many_arguments)] + fn py_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, + reduce_only: bool, + quote_quantity: bool, + init_id: UUID4, + ts_init: u64, + expire_time: Option, + display_qty: Option, + emulation_trigger: Option, + trigger_instrument_id: Option, + contingency_type: Option, + order_list_id: Option, + linked_order_ids: Option>, + parent_order_id: Option, + exec_algorithm_id: Option, + exec_algorithm_params: Option>, + exec_spawn_id: Option, + tags: Option, + ) -> PyResult { + let exec_algorithm_params = exec_algorithm_params.map(str_hashmap_to_ustr); + Ok(Self::new( + trader_id, + strategy_id, + instrument_id, + client_order_id, + order_side, + quantity, + trigger_price, + trigger_type, + time_in_force, + expire_time.map(|x| x.into()), + reduce_only, + quote_quantity, + display_qty, + emulation_trigger, + trigger_instrument_id, + contingency_type, + order_list_id, + linked_order_ids, + parent_order_id, + exec_algorithm_id, + exec_algorithm_params, + exec_spawn_id, + tags.map(|s| Ustr::from(&s)), + init_id, + ts_init.into(), + ) + .unwrap()) + } +} diff --git a/nautilus_core/model/src/python/orders/market_to_limit.rs b/nautilus_core/model/src/python/orders/market_to_limit.rs new file mode 100644 index 000000000000..514d46ced94c --- /dev/null +++ b/nautilus_core/model/src/python/orders/market_to_limit.rs @@ -0,0 +1,88 @@ +// ------------------------------------------------------------------------------------------------- +// Copyright (C) 2015-2024 Nautech Systems Pty Ltd. All rights reserved. +// https://nautechsystems.io +// +// Licensed under the GNU Lesser General Public License Version 3.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------------------------------- + +use std::collections::HashMap; + +use nautilus_core::uuid::UUID4; +use pyo3::prelude::*; +use ustr::Ustr; + +use crate::{ + enums::{ContingencyType, OrderSide, TimeInForce}, + identifiers::{ + client_order_id::ClientOrderId, exec_algorithm_id::ExecAlgorithmId, + instrument_id::InstrumentId, order_list_id::OrderListId, strategy_id::StrategyId, + trader_id::TraderId, + }, + orders::{base::str_hashmap_to_ustr, market_to_limit::MarketToLimitOrder}, + types::quantity::Quantity, +}; + +#[pymethods] +impl MarketToLimitOrder { + #[new] + #[allow(clippy::too_many_arguments)] + fn py_new( + trader_id: TraderId, + strategy_id: StrategyId, + instrument_id: InstrumentId, + client_order_id: ClientOrderId, + order_side: OrderSide, + quantity: Quantity, + time_in_force: TimeInForce, + post_only: bool, + reduce_only: bool, + quote_quantity: bool, + init_id: UUID4, + ts_init: u64, + expire_time: Option, + display_qty: Option, + contingency_type: Option, + order_list_id: Option, + linked_order_ids: Option>, + parent_order_id: Option, + exec_algorithm_id: Option, + exec_algorithm_params: Option>, + exec_spawn_id: Option, + tags: Option, + ) -> PyResult { + let exec_algorithm_params = exec_algorithm_params.map(str_hashmap_to_ustr); + Ok(Self::new( + trader_id, + strategy_id, + instrument_id, + client_order_id, + order_side, + quantity, + time_in_force, + expire_time.map(|x| x.into()), + post_only, + reduce_only, + quote_quantity, + display_qty, + contingency_type, + order_list_id, + linked_order_ids, + parent_order_id, + exec_algorithm_id, + exec_algorithm_params, + exec_spawn_id, + tags.map(|s| Ustr::from(&s)), + init_id, + ts_init.into(), + ) + .unwrap()) + } +} diff --git a/nautilus_core/model/src/python/orders/mod.rs b/nautilus_core/model/src/python/orders/mod.rs index 8ab2dd850a92..a18825784cb6 100644 --- a/nautilus_core/model/src/python/orders/mod.rs +++ b/nautilus_core/model/src/python/orders/mod.rs @@ -14,5 +14,11 @@ // ------------------------------------------------------------------------------------------------- pub mod limit; +pub mod limit_if_touched; pub mod market; +pub mod market_if_touched; +pub mod market_to_limit; pub mod stop_limit; +pub mod stop_market; +pub mod trailing_stop_limit; +pub mod trailing_stop_market; diff --git a/nautilus_core/model/src/python/orders/stop_limit.rs b/nautilus_core/model/src/python/orders/stop_limit.rs index 7722174fe7de..546089b84f16 100644 --- a/nautilus_core/model/src/python/orders/stop_limit.rs +++ b/nautilus_core/model/src/python/orders/stop_limit.rs @@ -79,7 +79,7 @@ impl StopLimitOrder { trigger_price, trigger_type, time_in_force, - expire_time.map(UnixNanos::from), + expire_time.map(|x| x.into()), post_only, reduce_only, quote_quantity, diff --git a/nautilus_core/model/src/python/orders/stop_market.rs b/nautilus_core/model/src/python/orders/stop_market.rs new file mode 100644 index 000000000000..2a78e231dbc4 --- /dev/null +++ b/nautilus_core/model/src/python/orders/stop_market.rs @@ -0,0 +1,94 @@ +// ------------------------------------------------------------------------------------------------- +// Copyright (C) 2015-2024 Nautech Systems Pty Ltd. All rights reserved. +// https://nautechsystems.io +// +// Licensed under the GNU Lesser General Public License Version 3.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------------------------------- + +use std::collections::HashMap; + +use nautilus_core::uuid::UUID4; +use pyo3::prelude::*; +use ustr::Ustr; + +use crate::{ + enums::{ContingencyType, OrderSide, TimeInForce, TriggerType}, + identifiers::{ + client_order_id::ClientOrderId, exec_algorithm_id::ExecAlgorithmId, + instrument_id::InstrumentId, order_list_id::OrderListId, strategy_id::StrategyId, + trader_id::TraderId, + }, + orders::{base::str_hashmap_to_ustr, stop_market::StopMarketOrder}, + types::{price::Price, quantity::Quantity}, +}; + +#[pymethods] +impl StopMarketOrder { + #[new] + #[allow(clippy::too_many_arguments)] + fn py_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, + reduce_only: bool, + quote_quantity: bool, + init_id: UUID4, + ts_init: u64, + expire_time: Option, + display_qty: Option, + emulation_trigger: Option, + trigger_instrument_id: Option, + contingency_type: Option, + order_list_id: Option, + linked_order_ids: Option>, + parent_order_id: Option, + exec_algorithm_id: Option, + exec_algorithm_params: Option>, + exec_spawn_id: Option, + tags: Option, + ) -> PyResult { + let exec_algorithm_params = exec_algorithm_params.map(str_hashmap_to_ustr); + Ok(Self::new( + trader_id, + strategy_id, + instrument_id, + client_order_id, + order_side, + quantity, + trigger_price, + trigger_type, + time_in_force, + expire_time.map(|x| x.into()), + reduce_only, + quote_quantity, + display_qty, + emulation_trigger, + trigger_instrument_id, + contingency_type, + order_list_id, + linked_order_ids, + parent_order_id, + exec_algorithm_id, + exec_algorithm_params, + exec_spawn_id, + tags.map(|s| Ustr::from(&s)), + init_id, + ts_init.into(), + ) + .unwrap()) + } +} diff --git a/nautilus_core/model/src/python/orders/trailing_stop_limit.rs b/nautilus_core/model/src/python/orders/trailing_stop_limit.rs new file mode 100644 index 000000000000..12a246321501 --- /dev/null +++ b/nautilus_core/model/src/python/orders/trailing_stop_limit.rs @@ -0,0 +1,104 @@ +// ------------------------------------------------------------------------------------------------- +// Copyright (C) 2015-2024 Nautech Systems Pty Ltd. All rights reserved. +// https://nautechsystems.io +// +// Licensed under the GNU Lesser General Public License Version 3.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------------------------------- + +use std::collections::HashMap; + +use nautilus_core::uuid::UUID4; +use pyo3::prelude::*; +use ustr::Ustr; + +use crate::{ + enums::{ContingencyType, OrderSide, TimeInForce, TrailingOffsetType, TriggerType}, + identifiers::{ + client_order_id::ClientOrderId, exec_algorithm_id::ExecAlgorithmId, + instrument_id::InstrumentId, order_list_id::OrderListId, strategy_id::StrategyId, + trader_id::TraderId, + }, + orders::{base::str_hashmap_to_ustr, trailing_stop_limit::TrailingStopLimitOrder}, + types::{price::Price, quantity::Quantity}, +}; + +#[pymethods] +impl TrailingStopLimitOrder { + #[new] + #[allow(clippy::too_many_arguments)] + fn py_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, + limit_offset: Price, + trailing_offset: Price, + trailing_offset_type: TrailingOffsetType, + time_in_force: TimeInForce, + post_only: bool, + reduce_only: bool, + quote_quantity: bool, + init_id: UUID4, + ts_init: u64, + expire_time: Option, + display_qty: Option, + emulation_trigger: Option, + trigger_instrument_id: Option, + contingency_type: Option, + order_list_id: Option, + linked_order_ids: Option>, + parent_order_id: Option, + exec_algorithm_id: Option, + exec_algorithm_params: Option>, + exec_spawn_id: Option, + tags: Option, + ) -> PyResult { + let exec_algorithm_params = exec_algorithm_params.map(str_hashmap_to_ustr); + Ok(Self::new( + trader_id, + strategy_id, + instrument_id, + client_order_id, + order_side, + quantity, + price, + trigger_price, + trigger_type, + limit_offset, + trailing_offset, + trailing_offset_type, + time_in_force, + expire_time.map(|x| x.into()), + post_only, + reduce_only, + quote_quantity, + display_qty, + emulation_trigger, + trigger_instrument_id, + contingency_type, + order_list_id, + linked_order_ids, + parent_order_id, + exec_algorithm_id, + exec_algorithm_params, + exec_spawn_id, + tags.map(|s| Ustr::from(&s)), + init_id, + ts_init.into(), + ) + .unwrap()) + } +} diff --git a/nautilus_core/model/src/python/orders/trailing_stop_market.rs b/nautilus_core/model/src/python/orders/trailing_stop_market.rs new file mode 100644 index 000000000000..d0e54939c3a6 --- /dev/null +++ b/nautilus_core/model/src/python/orders/trailing_stop_market.rs @@ -0,0 +1,98 @@ +// ------------------------------------------------------------------------------------------------- +// Copyright (C) 2015-2024 Nautech Systems Pty Ltd. All rights reserved. +// https://nautechsystems.io +// +// Licensed under the GNU Lesser General Public License Version 3.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------------------------------- + +use std::collections::HashMap; + +use nautilus_core::uuid::UUID4; +use pyo3::prelude::*; +use ustr::Ustr; + +use crate::{ + enums::{ContingencyType, OrderSide, TimeInForce, TrailingOffsetType, TriggerType}, + identifiers::{ + client_order_id::ClientOrderId, exec_algorithm_id::ExecAlgorithmId, + instrument_id::InstrumentId, order_list_id::OrderListId, strategy_id::StrategyId, + trader_id::TraderId, + }, + orders::{base::str_hashmap_to_ustr, trailing_stop_market::TrailingStopMarketOrder}, + types::{price::Price, quantity::Quantity}, +}; + +#[pymethods] +impl TrailingStopMarketOrder { + #[new] + #[allow(clippy::too_many_arguments)] + fn py_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, + trailing_offset: Price, + trailing_offset_type: TrailingOffsetType, + time_in_force: TimeInForce, + reduce_only: bool, + quote_quantity: bool, + init_id: UUID4, + ts_init: u64, + expire_time: Option, + display_qty: Option, + emulation_trigger: Option, + trigger_instrument_id: Option, + contingency_type: Option, + order_list_id: Option, + linked_order_ids: Option>, + parent_order_id: Option, + exec_algorithm_id: Option, + exec_algorithm_params: Option>, + exec_spawn_id: Option, + tags: Option, + ) -> PyResult { + let exec_algorithm_params = exec_algorithm_params.map(str_hashmap_to_ustr); + Ok(Self::new( + trader_id, + strategy_id, + instrument_id, + client_order_id, + order_side, + quantity, + trigger_price, + trigger_type, + trailing_offset, + trailing_offset_type, + time_in_force, + expire_time.map(|x| x.into()), + reduce_only, + quote_quantity, + display_qty, + emulation_trigger, + trigger_instrument_id, + contingency_type, + order_list_id, + linked_order_ids, + parent_order_id, + exec_algorithm_id, + exec_algorithm_params, + exec_spawn_id, + tags.map(|s| Ustr::from(&s)), + init_id, + ts_init.into(), + ) + .unwrap()) + } +} diff --git a/nautilus_trader/core/nautilus_pyo3.pyi b/nautilus_trader/core/nautilus_pyo3.pyi index f6da4b5bc633..8fde03eb68dc 100644 --- a/nautilus_trader/core/nautilus_pyo3.pyi +++ b/nautilus_trader/core/nautilus_pyo3.pyi @@ -962,7 +962,37 @@ class LimitOrder: def from_dict(cls, values: dict[str, str]) -> LimitOrder: ... -class LimitIfTouchedOrder: ... +class LimitIfTouchedOrder: + def __init__( + self, + 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, + post_only: bool, + reduce_only: bool, + quote_quantity: bool, + init_id: UUID4, + ts_init: int, + expire_time: int | None = None, + display_qty: Quantity | None = None, + emulation_trigger: TriggerType | None = None, + trigger_instrument_id: InstrumentId | None = None, + contingency_type: ContingencyType | None = None, + order_list_id: OrderListId | None = None, + linked_order_ids: list[ClientOrderId] | None = None, + parent_order_id: ClientOrderId | None = None, + exec_algorithm_id: ExecAlgorithmId | None = None, + exec_algorithm_params: dict[str, str] | None = None, + exec_spawn_id: ClientOrderId | None = None, + tags: str | None = None, + ) -> None: ... class MarketOrder: def __init__( @@ -975,13 +1005,13 @@ class MarketOrder: quantity: Quantity, init_id: UUID4, ts_init: int, - time_in_force: TimeInForce = ..., - reduce_only: bool = False, - quote_quantity: bool = False, + time_in_force: TimeInForce, + reduce_only: bool, + quote_quantity: bool, contingency_type: ContingencyType | None = None, order_list_id: OrderListId | None = None, linked_order_ids: list[ClientOrderId] | None = None, - parent_order_id: ClientOrderId | None = None, + parent_order_id: ClientOrderId | None = None, exec_algorithm_id: ExecAlgorithmId | None = None, exec_algorithm_params: dict[str, str] | None = None, exec_spawn_id: ClientOrderId | None = None, @@ -1023,7 +1053,62 @@ class MarketOrder: @property def price(self) -> Price | None: ... -class MarketToLimitOrder: ... +class MarketToLimitOrder: + def __init__( + self, + trader_id: TraderId, + strategy_id: StrategyId, + instrument_id: InstrumentId, + client_order_id: ClientOrderId, + order_side: OrderSide, + quantity: Quantity, + time_in_force: TimeInForce, + post_only: bool, + reduce_only: bool, + quote_quantity: bool, + init_id: UUID4, + ts_init: int, + expire_time: int | None = None, + display_qty: Quantity | None = None, + contingency_type: ContingencyType | None = None, + order_list_id: OrderListId | None = None, + linked_order_ids: list[ClientOrderId] | None = None, + parent_order_id: ClientOrderId | None = None, + exec_algorithm_id: ExecAlgorithmId | None = None, + exec_algorithm_params: dict[str, str] | None = None, + exec_spawn_id: ClientOrderId | None = None, + tags: str | None = None, + ): ... + +class MarketIfTouchedOrder: + def __init__( + self, + 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, + reduce_only: bool, + quote_quantity: bool, + init_id: UUID4, + ts_init: int, + expire_time: int | None = None, + display_qty: Quantity | None = None, + emulation_trigger: TriggerType | None = None, + trigger_instrument_id: InstrumentId | None = None, + contingency_type: ContingencyType | None = None, + order_list_id: OrderListId | None = None, + linked_order_ids: list[ClientOrderId] | None = None, + parent_order_id: ClientOrderId | None = None, + exec_algorithm_id: ExecAlgorithmId | None = None, + exec_algorithm_params: dict[str, str] | None = None, + exec_spawn_id: ClientOrderId | None = None, + tags: str | None = None, + ): ... class StopLimitOrder: def __init__( self, @@ -1103,9 +1188,100 @@ class StopLimitOrder: @property def expire_time(self) -> int | None: ... -class StopMarketOrder: ... -class TrailingStopLimitOrder: ... -class TrailingStopMarketOrder: ... +class StopMarketOrder: + def __init__( + self, + 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, + reduce_only: bool, + quote_quantity: bool, + init_id: UUID4, + ts_init: int, + expire_time: int | None = None, + display_qty: Quantity | None = None, + emulation_trigger: TriggerType | None = None, + trigger_instrument_id: InstrumentId | None = None, + contingency_type: ContingencyType | None = None, + order_list_id: OrderListId | None = None, + linked_order_ids: list[ClientOrderId] | None = None, + parent_order_id: ClientOrderId | None = None, + exec_algorithm_id: ExecAlgorithmId | None = None, + exec_algorithm_params: dict[str, str] | None = None, + exec_spawn_id: ClientOrderId | None = None, + tags: str | None = None, + ): ... +class TrailingStopLimitOrder: + def __init__( + self, + 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, + limit_offset: Price, + trailing_offset: Price, + trailing_offset_type: TrailingOffsetType, + time_in_force: TimeInForce, + post_only: bool, + reduce_only: bool, + quote_quantity: bool, + init_id: UUID4, + ts_init: int, + expire_time: int | None = None, + display_qty: Quantity | None = None, + emulation_trigger: TriggerType | None = None, + trigger_instrument_id: InstrumentId | None = None, + contingency_type: ContingencyType | None = None, + order_list_id: OrderListId | None = None, + linked_order_ids: list[ClientOrderId] | None = None, + parent_order_id: ClientOrderId | None = None, + exec_algorithm_id: ExecAlgorithmId | None = None, + exec_algorithm_params: dict[str, str] | None = None, + exec_spawn_id: ClientOrderId | None = None, + tags: str | None = None, + ): ... +class TrailingStopMarketOrder: + def __init__( + self, + trader_id: TraderId, + strategy_id: StrategyId, + instrument_id: InstrumentId, + client_order_id: ClientOrderId, + order_side: OrderSide, + quantity: Quantity, + trigger_price: Price, + trigger_type: TriggerType, + trailing_offset: Price, + trailing_offset_type: TrailingOffsetType, + time_in_force: TimeInForce, + reduce_only: bool, + quote_quantity: bool, + init_id: UUID4, + ts_init: int, + expire_time: int | None = None, + display_qty: Quantity | None = None, + emulation_trigger: TriggerType | None = None, + trigger_instrument_id: InstrumentId | None = None, + contingency_type: ContingencyType | None = None, + order_list_id: OrderListId | None = None, + linked_order_ids: list[ClientOrderId] | None = None, + parent_order_id: ClientOrderId | None = None, + exec_algorithm_id: ExecAlgorithmId | None = None, + exec_algorithm_params: dict[str, str] | None = None, + exec_spawn_id: ClientOrderId | None = None, + tags: str | None = None, + ): ... ### Objects