pub struct PlaceOrderParams {Show 15 fields
pub category: Category,
pub symbol: String,
pub side: Side,
pub order_type: OrderType,
pub qty: String,
pub price: Option<String>,
pub time_in_force: Option<TimeInForce>,
pub position_idx: Option<i32>,
pub order_link_id: Option<String>,
pub take_profit: Option<String>,
pub stop_loss: Option<String>,
pub reduce_only: Option<bool>,
pub close_on_trigger: Option<bool>,
pub trigger_price: Option<String>,
pub trigger_by: Option<TriggerBy>,
}Expand description
Place order request parameters.
Fields§
§category: CategoryProduct category
symbol: StringSymbol name
side: SideOrder side
order_type: OrderTypeOrder type
qty: StringOrder quantity
price: Option<String>Order price (required for limit orders)
time_in_force: Option<TimeInForce>Time in force
position_idx: Option<i32>Position index (for hedge mode)
order_link_id: Option<String>User-defined order ID
take_profit: Option<String>Take profit price
stop_loss: Option<String>Stop loss price
reduce_only: Option<bool>Reduce only flag
close_on_trigger: Option<bool>Close on trigger
trigger_price: Option<String>Trigger price
trigger_by: Option<TriggerBy>Trigger price type
Implementations§
Source§impl PlaceOrderParams
impl PlaceOrderParams
Sourcepub fn market(category: Category, symbol: &str, side: Side, qty: &str) -> Self
pub fn market(category: Category, symbol: &str, side: Side, qty: &str) -> Self
Create a new market order.
Sourcepub fn limit(
category: Category,
symbol: &str,
side: Side,
qty: &str,
price: &str,
) -> Self
pub fn limit( category: Category, symbol: &str, side: Side, qty: &str, price: &str, ) -> Self
Create a new limit order.
Sourcepub fn with_position_idx(self, idx: i32) -> Self
pub fn with_position_idx(self, idx: i32) -> Self
Set position index (for hedge mode).
Sourcepub fn with_order_link_id(self, id: &str) -> Self
pub fn with_order_link_id(self, id: &str) -> Self
Set user-defined order ID.
Sourcepub fn with_take_profit(self, price: &str) -> Self
pub fn with_take_profit(self, price: &str) -> Self
Set take profit price.
Sourcepub fn with_stop_loss(self, price: &str) -> Self
pub fn with_stop_loss(self, price: &str) -> Self
Set stop loss price.
Sourcepub fn with_reduce_only(self, reduce_only: bool) -> Self
pub fn with_reduce_only(self, reduce_only: bool) -> Self
Set reduce only flag.
Trait Implementations§
Source§impl Clone for PlaceOrderParams
impl Clone for PlaceOrderParams
Source§fn clone(&self) -> PlaceOrderParams
fn clone(&self) -> PlaceOrderParams
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 PlaceOrderParams
impl Debug for PlaceOrderParams
Auto Trait Implementations§
impl Freeze for PlaceOrderParams
impl RefUnwindSafe for PlaceOrderParams
impl Send for PlaceOrderParams
impl Sync for PlaceOrderParams
impl Unpin for PlaceOrderParams
impl UnsafeUnpin for PlaceOrderParams
impl UnwindSafe for PlaceOrderParams
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