pub struct PlaceOrderBuilder { /* private fields */ }Expand description
Builder for a validated PlaceOrder.
Implementations§
Source§impl PlaceOrderBuilder
impl PlaceOrderBuilder
Sourcepub const fn limit_price(self, limit_price: Decimal) -> Self
pub const fn limit_price(self, limit_price: Decimal) -> Self
Sets the optional limit price.
Sourcepub const fn stop_price(self, stop_price: Decimal) -> Self
pub const fn stop_price(self, stop_price: Decimal) -> Self
Sets the optional stop price.
Sourcepub const fn trail_price(self, trail_price: Decimal) -> Self
pub const fn trail_price(self, trail_price: Decimal) -> Self
Sets the absolute starting price level required for a trailing stop.
The provider derives a fixed tick distance from its last traded price when it receives the request, dropping fractional ticks. It checks tick alignment, quote availability, and a maximum distance of 1,000 ticks. These checks require provider state and are not performed by this builder. See the placement reference.
Sourcepub fn custom_tag(self, custom_tag: impl Into<String>) -> Self
pub fn custom_tag(self, custom_tag: impl Into<String>) -> Self
Sets the optional caller tag, which must be unique within the account.
Sourcepub fn stop_loss_bracket(self, stop_loss_bracket: Bracket) -> Self
pub fn stop_loss_bracket(self, stop_loss_bracket: Bracket) -> Self
Sets the optional stop-loss bracket.
Requires the account’s Auto OCO Brackets mode; see Bracket.
Sourcepub fn take_profit_bracket(self, take_profit_bracket: Bracket) -> Self
pub fn take_profit_bracket(self, take_profit_bracket: Bracket) -> Self
Sets the optional take-profit bracket.
Requires the account’s Auto OCO Brackets mode; see Bracket.
Sourcepub fn build(self) -> Result<PlaceOrder, RequestValidationError>
pub fn build(self) -> Result<PlaceOrder, RequestValidationError>
Validates and builds the order-placement request.
§Errors
Returns an error when the order quantity is zero or negative, when its
order type is undocumented for placement, or when its side code is
unknown to this crate version. Returns
RequestValidationError::MissingTrailPrice when a trailing stop has
no absolute starting price level.