pub struct PlaceOrder { /* private fields */ }Expand description
Order placement parameters.
Construct this request with PlaceOrder::builder, which prevents an
invalid non-positive quantity or trailing stop without a starting price
from reaching the transport.
Implementations§
Source§impl PlaceOrder
impl PlaceOrder
Sourcepub fn builder(
account_id: AccountId,
contract_id: ContractId,
order_type: OrderType,
side: Side,
quantity: i32,
) -> PlaceOrderBuilder
pub fn builder( account_id: AccountId, contract_id: ContractId, order_type: OrderType, side: Side, quantity: i32, ) -> PlaceOrderBuilder
Starts a validated order-placement request.
Sourcepub const fn account_id(&self) -> AccountId
pub const fn account_id(&self) -> AccountId
Returns the provider account.
Sourcepub const fn contract_id(&self) -> &ContractId
pub const fn contract_id(&self) -> &ContractId
Borrows the provider contract.
Sourcepub const fn order_type(&self) -> OrderType
pub const fn order_type(&self) -> OrderType
Returns the order type.
Sourcepub const fn limit_price(&self) -> Option<Decimal>
pub const fn limit_price(&self) -> Option<Decimal>
Returns the optional limit price.
Sourcepub const fn stop_price(&self) -> Option<Decimal>
pub const fn stop_price(&self) -> Option<Decimal>
Returns the optional stop price.
Sourcepub const fn trail_price(&self) -> Option<Decimal>
pub const fn trail_price(&self) -> Option<Decimal>
Returns the absolute starting price level for a trailing-stop order.
This input differs from the distance returned in Order::trail_price.
Sourcepub fn custom_tag(&self) -> Option<&str>
pub fn custom_tag(&self) -> Option<&str>
Borrows the optional caller tag.
Sourcepub const fn stop_loss_bracket(&self) -> Option<&Bracket>
pub const fn stop_loss_bracket(&self) -> Option<&Bracket>
Borrows the optional stop-loss bracket.
Sourcepub const fn take_profit_bracket(&self) -> Option<&Bracket>
pub const fn take_profit_bracket(&self) -> Option<&Bracket>
Borrows the optional take-profit bracket.
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
impl Eq for PlaceOrder
Source§impl PartialEq for PlaceOrder
impl PartialEq for PlaceOrder
Source§impl Serialize for PlaceOrder
impl Serialize for PlaceOrder
impl StructuralPartialEq for PlaceOrder
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