#[non_exhaustive]pub struct OrderRequest {
pub symbol: String,
pub side: OrderSide,
pub quantity: f64,
pub order_type: OrderType,
pub take_profit: Option<f64>,
pub take_profit_levels: Vec<TakeProfitLevel>,
pub stop_loss: Option<f64>,
pub time_in_force: TimeInForce,
pub position_bracket: Option<PositionBracket>,
}Expand description
An order as the user or the host asks for it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.symbol: StringThe symbol as the feed knows it.
side: OrderSideBuy or sell.
quantity: f64Positive, in the symbol’s trading units.
order_type: OrderTypeHow the order executes, with its prices.
take_profit: Option<f64>The price at which a take-profit order closes the filled quantity, for an account that
accepts brackets: above the entry for a buy, below for a sell.
None while take_profit_levels are set.
take_profit_levels: Vec<TakeProfitLevel>Several take profits, each closing its own quantity, for an account that accepts
take-profit levels, in the order given. Their
quantities add up to quantity. Empty for one take profit or none,
which take_profit holds.
stop_loss: Option<f64>The price at which a stop-loss order closes the filled quantity, for an account that accepts brackets: below the entry for a buy, above for a sell.
time_in_force: TimeInForceHow long the order stays working.
position_bracket: Option<PositionBracket>Explicit link to the net position in this symbol. Ordinary opposite-side orders are not brackets. Brokers should preserve this role on updates.
Implementations§
Trait Implementations§
Source§impl Clone for OrderRequest
impl Clone for OrderRequest
Source§fn clone(&self) -> OrderRequest
fn clone(&self) -> OrderRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OrderRequest
impl Debug for OrderRequest
Source§impl PartialEq for OrderRequest
impl PartialEq for OrderRequest
impl StructuralPartialEq for OrderRequest
Auto Trait Implementations§
impl Freeze for OrderRequest
impl RefUnwindSafe for OrderRequest
impl Send for OrderRequest
impl Sync for OrderRequest
impl Unpin for OrderRequest
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more