pub struct PlaceOrder {
pub client_id: ClientOrderId,
pub exchange: ExchangeInstance,
pub instrument: InstrumentId,
pub side: OrderSide,
pub price: Price,
pub qty: Qty,
pub tif: TimeInForce,
pub post_only: bool,
pub reduce_only: bool,
}Expand description
Place a new order
Fields§
§client_id: ClientOrderIdClient-generated unique order ID
exchange: ExchangeInstanceTarget exchange instance
instrument: InstrumentIdInstrument to trade
side: OrderSideBuy or Sell
price: PriceLimit price
qty: QtyQuantity
tif: TimeInForceTime in force (GTC, IOC, FOK)
post_only: boolPost-only (maker only)
reduce_only: boolReduce-only (close position only)
Implementations§
Source§impl PlaceOrder
impl PlaceOrder
Sourcepub fn limit(
exchange: ExchangeInstance,
instrument: InstrumentId,
side: OrderSide,
price: Price,
qty: Qty,
) -> Self
pub fn limit( exchange: ExchangeInstance, instrument: InstrumentId, side: OrderSide, price: Price, qty: Qty, ) -> Self
Create a new PlaceOrder command with defaults
Sourcepub fn with_tif(self, tif: TimeInForce) -> Self
pub fn with_tif(self, tif: TimeInForce) -> Self
Set time in force
Sourcepub fn reduce_only(self) -> Self
pub fn reduce_only(self) -> Self
Set reduce-only
Sourcepub fn with_client_id(self, client_id: ClientOrderId) -> Self
pub fn with_client_id(self, client_id: ClientOrderId) -> Self
Set a specific client order ID
Trait Implementations§
Source§impl Clone for PlaceOrder
impl Clone for PlaceOrder
Source§fn clone(&self) -> PlaceOrder
fn clone(&self) -> PlaceOrder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PlaceOrder
impl Debug for PlaceOrder
Source§impl<'de> Deserialize<'de> for PlaceOrder
impl<'de> Deserialize<'de> for PlaceOrder
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 PlaceOrder
impl RefUnwindSafe for PlaceOrder
impl Send for PlaceOrder
impl Sync for PlaceOrder
impl Unpin for PlaceOrder
impl UnsafeUnpin for PlaceOrder
impl UnwindSafe for PlaceOrder
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