pub struct PostOrderParamsBuilder { /* private fields */ }Expand description
Builder for PostOrderParams.
Implementations§
Source§impl PostOrderParamsBuilder
impl PostOrderParamsBuilder
Sourcepub fn symbol<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn symbol<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
Instrument symbol. e.g. ‘XBTUSD’.
Sourcepub fn side<VALUE: Into<BitmexSide>>(&mut self, value: VALUE) -> &mut Self
pub fn side<VALUE: Into<BitmexSide>>(&mut self, value: VALUE) -> &mut Self
Order side. Valid options: Buy, Sell. Defaults to ‘Buy’ unless orderQty is negative.
Sourcepub fn order_qty<VALUE: Into<u32>>(&mut self, value: VALUE) -> &mut Self
pub fn order_qty<VALUE: Into<u32>>(&mut self, value: VALUE) -> &mut Self
Order quantity in units of the instrument (i.e. contracts).
Sourcepub fn price<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
pub fn price<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
Optional limit price for Limit, StopLimit, and LimitIfTouched orders.
Sourcepub fn display_qty<VALUE: Into<u32>>(&mut self, value: VALUE) -> &mut Self
pub fn display_qty<VALUE: Into<u32>>(&mut self, value: VALUE) -> &mut Self
Optional quantity to display in the book. Use 0 for a fully hidden order.
Sourcepub fn stop_px<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
pub fn stop_px<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
Optional trigger price for Stop, StopLimit, MarketIfTouched, and LimitIfTouched orders. Use a price below the current price for stop-sell orders and buy-if-touched orders. Use execInst of MarkPrice or LastPrice to define the current price used for triggering.
Sourcepub fn cl_ord_id<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn cl_ord_id<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
Optional Client Order ID. This clOrdID will come back on the order and any related executions.
Sourcepub fn cl_ord_link_id<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn cl_ord_link_id<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
Optional Client Order Link ID for contingent orders.
Sourcepub fn peg_offset_value<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
pub fn peg_offset_value<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self
Optional trailing offset from the current price for Stop, StopLimit, MarketIfTouched, and LimitIfTouched orders; use a negative offset for stop-sell orders and buy-if-touched orders. Optional offset from the peg price for ‘Pegged’ orders.
Sourcepub fn peg_price_type<VALUE: Into<BitmexPegPriceType>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn peg_price_type<VALUE: Into<BitmexPegPriceType>>( &mut self, value: VALUE, ) -> &mut Self
Optional peg price type. Valid options: LastPeg, MidPricePeg, MarketPeg, PrimaryPeg, TrailingStopPeg.
Sourcepub fn ord_type<VALUE: Into<BitmexOrderType>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn ord_type<VALUE: Into<BitmexOrderType>>( &mut self, value: VALUE, ) -> &mut Self
Order type. Valid options: Market, Limit, Stop, StopLimit, MarketIfTouched, LimitIfTouched, Pegged. Defaults to Limit when price is specified. Defaults to Stop when stopPx is specified. Defaults to StopLimit when price and stopPx are specified.
Sourcepub fn time_in_force<VALUE: Into<BitmexTimeInForce>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn time_in_force<VALUE: Into<BitmexTimeInForce>>( &mut self, value: VALUE, ) -> &mut Self
Time in force. Valid options: Day, GoodTillCancel, ImmediateOrCancel, FillOrKill. Defaults to GoodTillCancel for Limit, StopLimit, and LimitIfTouched orders.
Sourcepub fn exec_inst<VALUE: Into<Vec<BitmexExecInstruction>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn exec_inst<VALUE: Into<Vec<BitmexExecInstruction>>>( &mut self, value: VALUE, ) -> &mut Self
Optional execution instructions. Valid options: ParticipateDoNotInitiate, AllOrNone, MarkPrice, IndexPrice, LastPrice, Close, ReduceOnly, Fixed. AllOrNone instruction requires displayQty to be 0. MarkPrice, IndexPrice or LastPrice instruction valid for Stop, StopLimit, MarketIfTouched, and LimitIfTouched orders.
Sourcepub fn contingency_type<VALUE: Into<BitmexContingencyType>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn contingency_type<VALUE: Into<BitmexContingencyType>>( &mut self, value: VALUE, ) -> &mut Self
Deprecated: linked orders are not supported after 2018/11/10.
Sourcepub fn text<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn text<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
Optional order annotation. e.g. ‘Take profit’.
Sourcepub fn build(&self) -> Result<PostOrderParams, PostOrderParamsBuilderError>
pub fn build(&self) -> Result<PostOrderParams, PostOrderParamsBuilderError>
Trait Implementations§
Source§impl Clone for PostOrderParamsBuilder
impl Clone for PostOrderParamsBuilder
Source§fn clone(&self) -> PostOrderParamsBuilder
fn clone(&self) -> PostOrderParamsBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for PostOrderParamsBuilder
impl RefUnwindSafe for PostOrderParamsBuilder
impl Send for PostOrderParamsBuilder
impl Sync for PostOrderParamsBuilder
impl Unpin for PostOrderParamsBuilder
impl UnwindSafe for PostOrderParamsBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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