pub struct OrderRequest {Show 15 fields
pub client_order_id: SmartString<LazyCompact>,
pub venue: Exchange,
pub symbol: SmartString<LazyCompact>,
pub side: OrderSide,
pub order_type: OrderType,
pub quantity: Decimal,
pub price: Option<Decimal>,
pub stop_price: Option<Decimal>,
pub time_in_force: Option<TimeInForce>,
pub reduce_only: bool,
pub timestamp_ns: u64,
pub strategy_id: SmartString<LazyCompact>,
pub extra_params: OwnedValue,
pub take_profit: Option<Decimal>,
pub stop_loss: Option<Decimal>,
}Expand description
Order request representation
Fields§
§client_order_id: SmartString<LazyCompact>Client-assigned order ID
venue: ExchangeExchange venue for the order
symbol: SmartString<LazyCompact>Trading symbol (e.g., “BTCUSDT”)
side: OrderSideOrder side (buy or sell)
order_type: OrderTypeOrder type (market, limit, etc.)
quantity: DecimalQuantity to trade
price: Option<Decimal>Price (required for limit orders)
stop_price: Option<Decimal>Stop price (required for stop orders)
time_in_force: Option<TimeInForce>Time in force
reduce_only: boolOrder is reducing only (close position)
timestamp_ns: u64Request timestamp in nanoseconds
strategy_id: SmartString<LazyCompact>Strategy ID that created this order
extra_params: OwnedValueAdditional order parameters
take_profit: Option<Decimal>Take profit price
stop_loss: Option<Decimal>Stop loss price
Implementations§
Source§impl OrderRequest
impl OrderRequest
Sourcepub fn new(
client_order_id: impl Into<SmartString<LazyCompact>>,
venue: Venue,
symbol: impl Into<SmartString<LazyCompact>>,
side: OrderSide,
order_type: OrderType,
quantity: Decimal,
price: Option<Decimal>,
strategy_id: impl Into<SmartString<LazyCompact>>,
) -> Self
pub fn new( client_order_id: impl Into<SmartString<LazyCompact>>, venue: Venue, symbol: impl Into<SmartString<LazyCompact>>, side: OrderSide, order_type: OrderType, quantity: Decimal, price: Option<Decimal>, strategy_id: impl Into<SmartString<LazyCompact>>, ) -> Self
Create a new order request with current timestamp
Sourcepub fn market_buy(
venue: Venue,
symbol: impl Into<SmartString<LazyCompact>>,
quantity: Decimal,
strategy_id: impl Into<SmartString<LazyCompact>>,
) -> Self
pub fn market_buy( venue: Venue, symbol: impl Into<SmartString<LazyCompact>>, quantity: Decimal, strategy_id: impl Into<SmartString<LazyCompact>>, ) -> Self
Create a market buy order
Sourcepub fn market_sell(
venue: Venue,
symbol: impl Into<SmartString<LazyCompact>>,
quantity: Decimal,
strategy_id: impl Into<SmartString<LazyCompact>>,
) -> Self
pub fn market_sell( venue: Venue, symbol: impl Into<SmartString<LazyCompact>>, quantity: Decimal, strategy_id: impl Into<SmartString<LazyCompact>>, ) -> Self
Create a market sell order
Sourcepub fn limit_buy(
venue: Venue,
symbol: impl Into<SmartString<LazyCompact>>,
quantity: Decimal,
price: Decimal,
strategy_id: impl Into<SmartString<LazyCompact>>,
) -> Self
pub fn limit_buy( venue: Venue, symbol: impl Into<SmartString<LazyCompact>>, quantity: Decimal, price: Decimal, strategy_id: impl Into<SmartString<LazyCompact>>, ) -> Self
Create a limit buy order
Sourcepub fn limit_sell(
venue: Venue,
symbol: impl Into<SmartString<LazyCompact>>,
quantity: Decimal,
price: Decimal,
strategy_id: impl Into<SmartString<LazyCompact>>,
) -> Self
pub fn limit_sell( venue: Venue, symbol: impl Into<SmartString<LazyCompact>>, quantity: Decimal, price: Decimal, strategy_id: impl Into<SmartString<LazyCompact>>, ) -> Self
Create a limit sell order
Trait Implementations§
Source§impl Clone for OrderRequest
impl Clone for OrderRequest
Source§fn clone(&self) -> OrderRequest
fn clone(&self) -> OrderRequest
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 OrderRequest
impl Debug for OrderRequest
Source§impl<'de> Deserialize<'de> for OrderRequest
impl<'de> Deserialize<'de> for OrderRequest
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
Auto Trait Implementations§
impl Freeze for OrderRequest
impl RefUnwindSafe for OrderRequest
impl Send for OrderRequest
impl Sync for OrderRequest
impl Unpin for OrderRequest
impl UnwindSafe for OrderRequest
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