pub struct OptionOrderRequest {
pub client_order_id: String,
pub contract_id: String,
pub quantity: f64,
pub side: OrderSide,
pub order_type: OrderType,
pub time_in_force: TimeInForce,
pub extended_hours: bool,
pub price: Option<f64>,
pub stop_price: Option<f64>,
}Expand description
Option order request.
Fields§
§client_order_id: StringClient order ID
contract_id: StringOption contract ID
quantity: f64Quantity of contracts
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
price: Option<f64>Limit price (for limit orders)
stop_price: Option<f64>Stop price (for stop orders)
Implementations§
Source§impl OptionOrderRequest
impl OptionOrderRequest
Sourcepub fn new(
client_order_id: impl Into<String>,
contract_id: impl Into<String>,
quantity: f64,
) -> Self
pub fn new( client_order_id: impl Into<String>, contract_id: impl Into<String>, quantity: f64, ) -> Self
Create a new option order request.
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.
Sourcepub fn stop_price(self, stop_price: f64) -> Self
pub fn stop_price(self, stop_price: f64) -> Self
Set the stop price.
Trait Implementations§
Source§impl Clone for OptionOrderRequest
impl Clone for OptionOrderRequest
Source§fn clone(&self) -> OptionOrderRequest
fn clone(&self) -> OptionOrderRequest
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 OptionOrderRequest
impl Debug for OptionOrderRequest
Source§impl<'de> Deserialize<'de> for OptionOrderRequest
impl<'de> Deserialize<'de> for OptionOrderRequest
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 OptionOrderRequest
impl RefUnwindSafe for OptionOrderRequest
impl Send for OptionOrderRequest
impl Sync for OptionOrderRequest
impl Unpin for OptionOrderRequest
impl UnwindSafe for OptionOrderRequest
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