pub struct SendOrderRequest {
pub order_type: FuturesOrderType,
pub symbol: String,
pub side: BuySell,
pub size: Decimal,
pub limit_price: Option<Decimal>,
pub stop_price: Option<Decimal>,
pub trigger_signal: Option<String>,
pub reduce_only: Option<bool>,
pub cli_ord_id: Option<String>,
}Expand description
Request to send a new order.
Fields§
§order_type: FuturesOrderTypeThe order type (lmt, mkt, stp, take_profit, ioc)
symbol: StringThe symbol (e.g., “PI_XBTUSD”)
side: BuySellOrder side (buy or sell)
size: DecimalOrder size (number of contracts)
limit_price: Option<Decimal>Limit price (required for limit orders)
stop_price: Option<Decimal>Stop price (required for stop orders)
trigger_signal: Option<String>Trigger signal for stop orders (mark or last)
reduce_only: Option<bool>Reduce-only order
cli_ord_id: Option<String>Client order ID
Implementations§
Source§impl SendOrderRequest
impl SendOrderRequest
Sourcepub fn limit(
symbol: impl Into<String>,
side: BuySell,
size: Decimal,
price: Decimal,
) -> Self
pub fn limit( symbol: impl Into<String>, side: BuySell, size: Decimal, price: Decimal, ) -> Self
Create a new limit order request.
Sourcepub fn market(symbol: impl Into<String>, side: BuySell, size: Decimal) -> Self
pub fn market(symbol: impl Into<String>, side: BuySell, size: Decimal) -> Self
Create a new market order request.
Sourcepub fn stop(
symbol: impl Into<String>,
side: BuySell,
size: Decimal,
stop_price: Decimal,
) -> Self
pub fn stop( symbol: impl Into<String>, side: BuySell, size: Decimal, stop_price: Decimal, ) -> Self
Create a new stop order request.
Sourcepub fn reduce_only(self, reduce_only: bool) -> Self
pub fn reduce_only(self, reduce_only: bool) -> Self
Set the reduce-only flag.
Sourcepub fn cli_ord_id(self, id: impl Into<String>) -> Self
pub fn cli_ord_id(self, id: impl Into<String>) -> Self
Set a client order ID.
Sourcepub fn trigger_signal(self, signal: impl Into<String>) -> Self
pub fn trigger_signal(self, signal: impl Into<String>) -> Self
Set the trigger signal for stop orders.
Trait Implementations§
Source§impl Clone for SendOrderRequest
impl Clone for SendOrderRequest
Source§fn clone(&self) -> SendOrderRequest
fn clone(&self) -> SendOrderRequest
Returns a duplicate 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 SendOrderRequest
impl Debug for SendOrderRequest
Auto Trait Implementations§
impl Freeze for SendOrderRequest
impl RefUnwindSafe for SendOrderRequest
impl Send for SendOrderRequest
impl Sync for SendOrderRequest
impl Unpin for SendOrderRequest
impl UnwindSafe for SendOrderRequest
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