pub struct AlgoOrderRequest { /* private fields */ }Expand description
Request body for POST /api/v5/trade/order-algo.
Implementations§
Source§impl AlgoOrderRequest
impl AlgoOrderRequest
Sourcepub 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
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.
Sourcepub fn full_close(self) -> Self
pub fn full_close(self) -> Self
Replace sz with the only currently supported full-close fraction, 1.
Sourcepub fn position_side(self, value: impl Into<String>) -> Self
pub fn position_side(self, value: impl Into<String>) -> Self
Set the position side (long, short, or net).
Sourcepub fn reduce_only(self, value: bool) -> Self
pub fn reduce_only(self, value: bool) -> Self
Set the reduce-only flag.
Sourcepub fn client_algo_order_id(self, value: impl Into<String>) -> Self
pub fn client_algo_order_id(self, value: impl Into<String>) -> Self
Set the client-supplied algo ID.
Sourcepub fn target_currency(self, value: impl Into<String>) -> Self
pub fn target_currency(self, value: impl Into<String>) -> Self
Set the Spot quantity unit (base_ccy or quote_ccy).
Sourcepub fn trade_quote_currency(self, value: impl Into<String>) -> Self
pub fn trade_quote_currency(self, value: impl Into<String>) -> Self
Set the quote currency used for Spot trading.
Sourcepub fn trigger(self, px: impl Into<String>, order_px: impl Into<String>) -> Self
pub fn trigger(self, px: impl Into<String>, order_px: impl Into<String>) -> Self
Configure a trigger order’s trigger and execution prices.
Sourcepub fn advance_order_type(self, value: impl Into<String>) -> Self
pub fn advance_order_type(self, value: impl Into<String>) -> Self
Set trigger execution type (fok or ioc).
Sourcepub fn trigger_price_type(self, value: impl Into<String>) -> Self
pub fn trigger_price_type(self, value: impl Into<String>) -> Self
Set trigger price type (last, index, or mark).
Sourcepub fn take_profit(
self,
trigger_px: impl Into<String>,
order_px: impl Into<String>,
) -> Self
pub fn take_profit( self, trigger_px: impl Into<String>, order_px: impl Into<String>, ) -> Self
Configure take-profit trigger and order prices.
Sourcepub fn limit_take_profit(self, order_px: impl Into<String>) -> Self
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.
Sourcepub fn take_profit_price_type(self, value: impl Into<String>) -> Self
pub fn take_profit_price_type(self, value: impl Into<String>) -> Self
Set the take-profit trigger source.
Sourcepub fn stop_loss(
self,
trigger_px: impl Into<String>,
order_px: impl Into<String>,
) -> Self
pub fn stop_loss( self, trigger_px: impl Into<String>, order_px: impl Into<String>, ) -> Self
Configure stop-loss trigger and order prices.
Sourcepub fn stop_loss_price_type(self, value: impl Into<String>) -> Self
pub fn stop_loss_price_type(self, value: impl Into<String>) -> Self
Set the stop-loss trigger source.
Sourcepub fn cancel_on_close_position(self, value: bool) -> Self
pub fn cancel_on_close_position(self, value: bool) -> Self
Associate TP/SL cancellation with a fully closed position.
Sourcepub fn attached_algo_orders(self, values: Vec<AttachedAlgoOrderRequest>) -> Self
pub fn attached_algo_orders(self, values: Vec<AttachedAlgoOrderRequest>) -> Self
Attach TP/SL definitions to the triggered order.
Sourcepub fn callback_ratio(self, value: impl Into<String>) -> Self
pub fn callback_ratio(self, value: impl Into<String>) -> Self
Set a trailing-order callback ratio.
Sourcepub fn callback_spread(self, value: impl Into<String>) -> Self
pub fn callback_spread(self, value: impl Into<String>) -> Self
Set a trailing-order callback spread.
Sourcepub fn active_price(self, value: impl Into<String>) -> Self
pub fn active_price(self, value: impl Into<String>) -> Self
Set a trailing-order activation price.
Sourcepub fn chase(
self,
chase_type: impl Into<String>,
chase_val: impl Into<String>,
) -> Self
pub fn chase( self, chase_type: impl Into<String>, chase_val: impl Into<String>, ) -> Self
Configure chase type and value.
Sourcepub fn maximum_chase(
self,
chase_type: impl Into<String>,
chase_val: impl Into<String>,
) -> Self
pub fn maximum_chase( self, chase_type: impl Into<String>, chase_val: impl Into<String>, ) -> Self
Configure the optional maximum chase type and value.
Sourcepub 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
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.
Sourcepub 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
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.
Sourcepub fn smart_iceberg(
self,
sz_limit: impl Into<String>,
lmt_order_number: impl Into<String>,
aggressiveness: impl Into<String>,
) -> Self
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.
Sourcepub fn price_limit(self, value: impl Into<String>) -> Self
pub fn price_limit(self, value: impl Into<String>) -> Self
Set an optional Smart Iceberg price limit.
Sourcepub fn smart_iceberg_triggers(
self,
values: Vec<SmartIcebergTriggerRequest>,
) -> Self
pub fn smart_iceberg_triggers( self, values: Vec<SmartIcebergTriggerRequest>, ) -> Self
Set Smart Iceberg trigger parameters.
Trait Implementations§
Source§impl Clone for AlgoOrderRequest
impl Clone for AlgoOrderRequest
Source§fn clone(&self) -> AlgoOrderRequest
fn clone(&self) -> AlgoOrderRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more