pub struct OrderRequestBuilder { /* private fields */ }Expand description
The initial stage of an Order, this is what
is sent to the route for creating a Order.
Implementations§
Source§impl OrderRequestBuilder
impl OrderRequestBuilder
Sourcepub fn account_id(self, id: impl Into<String>) -> Self
pub fn account_id(self, id: impl Into<String>) -> Self
Set the Account ID the OrderRequest belongs to.
NOTE: Required to be set to build an OrderRequest.
Sourcepub fn order_type(self, order_type: OrderType) -> Self
pub fn order_type(self, order_type: OrderType) -> Self
Set the Order Type for the OrderRequest.
NOTE: Required to be set to build an OrderRequest.
Sourcepub fn symbol(self, symbol: impl Into<String>) -> Self
pub fn symbol(self, symbol: impl Into<String>) -> Self
Set the Symbol the OrderRequest is for.
NOTE: Required to be set to build an OrderRequest.
Sourcepub fn time_in_force(self, time_in_force: OrderTimeInForce) -> Self
pub fn time_in_force(self, time_in_force: OrderTimeInForce) -> Self
Set the Time In Force (Duration or expiration timestamp)
for the OrderRequest.
NOTE: Required to be set to build an OrderRequest.
Sourcepub fn quantity(self, quantity: impl Into<String>) -> Self
pub fn quantity(self, quantity: impl Into<String>) -> Self
Set the Quantity of shares or contracts for the OrderRequest.
Sourcepub fn trade_action(self, action: TradeAction) -> Self
pub fn trade_action(self, action: TradeAction) -> Self
Set the Trade Action for the OrderRequest.
NOTE: Required to be set to build an OrderRequest.
Sourcepub fn route(self, route: impl Into<String>) -> Self
pub fn route(self, route: impl Into<String>) -> Self
Set the Execution Route for the OrderRequest.
Sourcepub fn stop_price(self, price: impl Into<String>) -> Self
pub fn stop_price(self, price: impl Into<String>) -> Self
Set a Stop Price for the OrderRequest.
Sourcepub fn order_confirm_id(self, id: impl Into<String>) -> Self
pub fn order_confirm_id(self, id: impl Into<String>) -> Self
Set an Order Confirm ID for the OrderRequest.
Sourcepub fn limit_price(self, price: impl Into<String>) -> Self
pub fn limit_price(self, price: impl Into<String>) -> Self
Set a Limit Price for the OrderRequest.
Sourcepub fn legs(self, legs: Vec<OrderRequestLeg>) -> Self
pub fn legs(self, legs: Vec<OrderRequestLeg>) -> Self
Set the Legs of the OrderRequest.
Sourcepub fn buying_power_warning(self, status: BPWarningStatus) -> Self
pub fn buying_power_warning(self, status: BPWarningStatus) -> Self
Set the Buying Power Warning Status for the OrderRequest.
Sourcepub fn advanced_options(self, options: AdvancedOrderOptions) -> Self
pub fn advanced_options(self, options: AdvancedOrderOptions) -> Self
Set the Advanced Options for the OrderRequest.
Sourcepub fn build(self) -> Result<OrderRequest, Error>
pub fn build(self) -> Result<OrderRequest, Error>
Finish building the OrderRequest.
NOTE: account_id, order_type, quantity, symbol,
time_in_force, and trade_action are all required.