Skip to main content

AlgoOrderRequest

Struct AlgoOrderRequest 

Source
pub struct AlgoOrderRequest { /* private fields */ }
Expand description

Request body for POST /api/v5/trade/order-algo.

Implementations§

Source§

impl AlgoOrderRequest

Source

pub fn new( inst_id: impl Into<String>, td_mode: impl Into<String>, side: impl Into<String>, ord_type: impl Into<String>, sz: impl Into<String>, ) -> Self

Create an algo-order request with a quantity.

Source

pub fn full_close(self) -> Self

Replace sz with the only currently supported full-close fraction, 1.

Source

pub fn currency(self, value: impl Into<String>) -> Self

Set the margin currency.

Source

pub fn position_side(self, value: impl Into<String>) -> Self

Set the position side (long, short, or net).

Source

pub fn reduce_only(self, value: bool) -> Self

Set the reduce-only flag.

Source

pub fn client_algo_order_id(self, value: impl Into<String>) -> Self

Set the client-supplied algo ID.

Source

pub fn target_currency(self, value: impl Into<String>) -> Self

Set the Spot quantity unit (base_ccy or quote_ccy).

Source

pub fn trade_quote_currency(self, value: impl Into<String>) -> Self

Set the quote currency used for Spot trading.

Source

pub fn trigger(self, px: impl Into<String>, order_px: impl Into<String>) -> Self

Configure a trigger order’s trigger and execution prices.

Source

pub fn advance_order_type(self, value: impl Into<String>) -> Self

Set trigger execution type (fok or ioc).

Source

pub fn trigger_price_type(self, value: impl Into<String>) -> Self

Set trigger price type (last, index, or mark).

Source

pub fn take_profit( self, trigger_px: impl Into<String>, order_px: impl Into<String>, ) -> Self

Configure take-profit trigger and order prices.

Source

pub fn limit_take_profit(self, order_px: impl Into<String>) -> Self

Configure a limit take-profit order that does not require a trigger price.

Source

pub fn take_profit_price_type(self, value: impl Into<String>) -> Self

Set the take-profit trigger source.

Source

pub fn stop_loss( self, trigger_px: impl Into<String>, order_px: impl Into<String>, ) -> Self

Configure stop-loss trigger and order prices.

Source

pub fn stop_loss_price_type(self, value: impl Into<String>) -> Self

Set the stop-loss trigger source.

Source

pub fn cancel_on_close_position(self, value: bool) -> Self

Associate TP/SL cancellation with a fully closed position.

Source

pub fn attached_algo_orders(self, values: Vec<AttachedAlgoOrderRequest>) -> Self

Attach TP/SL definitions to the triggered order.

Source

pub fn callback_ratio(self, value: impl Into<String>) -> Self

Set a trailing-order callback ratio.

Source

pub fn callback_spread(self, value: impl Into<String>) -> Self

Set a trailing-order callback spread.

Source

pub fn active_price(self, value: impl Into<String>) -> Self

Set a trailing-order activation price.

Source

pub fn chase( self, chase_type: impl Into<String>, chase_val: impl Into<String>, ) -> Self

Configure chase type and value.

Source

pub fn maximum_chase( self, chase_type: impl Into<String>, chase_val: impl Into<String>, ) -> Self

Configure the optional maximum chase type and value.

Source

pub fn twap_by_variance( self, px_var: impl Into<String>, sz_limit: impl Into<String>, px_limit: impl Into<String>, time_interval: impl Into<String>, ) -> Self

Configure TWAP strategy fields using a percentage variance.

Source

pub fn twap_by_spread( self, px_spread: impl Into<String>, sz_limit: impl Into<String>, px_limit: impl Into<String>, time_interval: impl Into<String>, ) -> Self

Configure TWAP strategy fields using an absolute price spread.

Source

pub fn smart_iceberg( self, sz_limit: impl Into<String>, lmt_order_number: impl Into<String>, aggressiveness: impl Into<String>, ) -> Self

Configure required Smart Iceberg execution fields.

Source

pub fn price_limit(self, value: impl Into<String>) -> Self

Set an optional Smart Iceberg price limit.

Source

pub fn smart_iceberg_triggers( self, values: Vec<SmartIcebergTriggerRequest>, ) -> Self

Set Smart Iceberg trigger parameters.

Source

pub fn tag(self, value: impl Into<String>) -> Self

Set an order tag of at most 16 ASCII alphanumeric characters.

Trait Implementations§

Source§

impl Clone for AlgoOrderRequest

Source§

fn clone(&self) -> AlgoOrderRequest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AlgoOrderRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for AlgoOrderRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ValidateRequest for AlgoOrderRequest

Source§

fn validate(&self) -> Result<(), RequestValidationError>

Validate all constraints represented by this SDK version.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more