pub struct OrderRequest {
pub symbol: String,
pub quantity: f64,
pub price: Option<f64>,
pub stop_price: Option<f64>,
pub side: OrderSide,
pub order_type: OrderType,
pub time_in_force: TimeInForce,
pub extended_hours: bool,
}Expand description
Request to place an order.
Fields§
§symbol: StringSymbol of the security
quantity: f64Quantity of shares
price: Option<f64>Price of the order (for limit orders)
stop_price: Option<f64>Stop price (for stop orders)
side: OrderSideOrder side (buy/sell)
order_type: OrderTypeOrder type
time_in_force: TimeInForceTime in force
extended_hours: boolWhether the order is for extended hours trading
Implementations§
Source§impl OrderRequest
impl OrderRequest
Sourcepub fn stop_price(self, stop_price: f64) -> Self
pub fn stop_price(self, stop_price: f64) -> Self
Set the stop price.
Sourcepub fn order_type(self, order_type: OrderType) -> Self
pub fn order_type(self, order_type: OrderType) -> Self
Set the order type.
Sourcepub fn time_in_force(self, time_in_force: TimeInForce) -> Self
pub fn time_in_force(self, time_in_force: TimeInForce) -> Self
Set the time in force.
Sourcepub fn extended_hours(self, extended_hours: bool) -> Self
pub fn extended_hours(self, extended_hours: bool) -> Self
Set whether the order is for extended hours trading.
Trait Implementations§
Source§impl Clone for OrderRequest
impl Clone for OrderRequest
Source§fn clone(&self) -> OrderRequest
fn clone(&self) -> OrderRequest
Returns a copy 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 OrderRequest
impl Debug for OrderRequest
Source§impl Default for OrderRequest
impl Default 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