[][src]Struct alpaca_finance::OrderBuilder

pub struct OrderBuilder { /* fields omitted */ }

Builds up a new order and has the logic to submit the order

This structure is not create directly - but is returned from Order.buy or Order.sell

Implementations

impl OrderBuilder[src]

pub fn extended_hours(self, extended_hours: bool) -> OrderBuilder[src]

Sets the extended hours flag

pub fn limit_price(self, limit_price: f64) -> OrderBuilder[src]

Sets the price limit

pub fn stop_price(self, stop_price: f64) -> OrderBuilder[src]

Sets the stop price

pub async fn place<'_, '_>(&'_ self, alpaca: &'_ Alpaca) -> Result<Order>[src]

Attempts to place the order. Will fail if certain preconditions aren't met, including:

  • Limit order with no limit price
  • Stop order with no stop price
  • Extended hours requested for non limit orders where time_in_force is not Day

Trait Implementations

impl Debug for OrderBuilder[src]

impl Default for OrderBuilder[src]

impl Serialize for OrderBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,