Struct bybit::model::OrderRequest

source ·
pub struct OrderRequest<'a> {
Show 29 fields pub category: Category, pub symbol: Cow<'a, str>, pub is_leverage: Option<bool>, pub side: Side, pub order_type: OrderType, pub qty: f64, pub market_unit: Option<f64>, pub price: Option<f64>, pub trigger_direction: Option<bool>, pub order_filter: Option<Cow<'a, str>>, pub trigger_price: Option<f64>, pub trigger_by: Option<Cow<'a, str>>, pub order_iv: Option<f64>, pub time_in_force: Option<Cow<'a, str>>, pub position_idx: Option<u8>, pub order_link_id: Option<Cow<'a, str>>, pub take_profit: Option<f64>, pub stop_loss: Option<f64>, pub tp_trigger_by: Option<Cow<'a, str>>, pub sl_trigger_by: Option<Cow<'a, str>>, pub reduce_only: Option<bool>, pub close_on_trigger: Option<bool>, pub smp_type: Option<Cow<'a, str>>, pub mmp: Option<bool>, pub tpsl_mode: Option<Cow<'a, str>>, pub tp_limit_price: Option<f64>, pub sl_limit_price: Option<f64>, pub tp_order_type: Option<Cow<'a, str>>, pub sl_order_type: Option<Cow<'a, str>>,
}

Fields§

§category: Category§symbol: Cow<'a, str>§is_leverage: Option<bool>§side: Side§order_type: OrderType§qty: f64§market_unit: Option<f64>§price: Option<f64>§trigger_direction: Option<bool>§order_filter: Option<Cow<'a, str>>§trigger_price: Option<f64>§trigger_by: Option<Cow<'a, str>>§order_iv: Option<f64>§time_in_force: Option<Cow<'a, str>>§position_idx: Option<u8>§order_link_id: Option<Cow<'a, str>>§take_profit: Option<f64>§stop_loss: Option<f64>§tp_trigger_by: Option<Cow<'a, str>>§sl_trigger_by: Option<Cow<'a, str>>§reduce_only: Option<bool>§close_on_trigger: Option<bool>§smp_type: Option<Cow<'a, str>>§mmp: Option<bool>§tpsl_mode: Option<Cow<'a, str>>§tp_limit_price: Option<f64>§sl_limit_price: Option<f64>§tp_order_type: Option<Cow<'a, str>>§sl_order_type: Option<Cow<'a, str>>

Implementations§

source§

impl<'a> OrderRequest<'a>

source

pub fn default() -> Self

source

pub fn custom( category: Category, symbol: &'a str, leverage: Option<bool>, side: Side, order_type: OrderType, qty: f64, market_unit: Option<f64>, price: Option<f64>, trigger_direction: Option<bool>, order_filter: Option<&'a str>, trigger_price: Option<f64>, trigger_by: Option<&'a str>, order_iv: Option<f64>, time_in_force: Option<&'a str>, position_idx: Option<u8>, order_link_id: Option<&'a str>, take_profit: Option<f64>, stop_loss: Option<f64>, tp_trigger_by: Option<&'a str>, sl_trigger_by: Option<&'a str>, reduce_only: Option<bool>, close_on_trigger: Option<bool>, smp_type: Option<&'a str>, mmp: Option<bool>, tpsl_mode: Option<&'a str>, tp_limit_price: Option<f64>, sl_limit_price: Option<f64>, tp_order_type: Option<&'a str>, sl_order_type: Option<&'a str> ) -> Self

source

pub fn spot_limit_with_market_tpsl( symbol: &'a str, side: Side, qty: f64, price: f64, tp: f64, sl: f64 ) -> Self

source

pub fn spot_limit_with_limit_tpsl( symbol: &'a str, side: Side, qty: f64, price: f64, tp: f64, sl: f64 ) -> Self

source

pub fn spot_postonly(symbol: &'a str, side: Side, qty: f64, price: f64) -> Self

source

pub fn spot_tpsl( symbol: &'a str, side: Side, price: f64, qty: f64, order_link_id: Option<&'a str> ) -> Self

source

pub fn spot_margin(symbol: &'a str, side: Side, qty: f64, price: f64) -> Self

source

pub fn spot_market(symbol: &'a str, side: Side, qty: f64) -> Self

source

pub fn futures_limit_with_market_tpsl( symbol: &'a str, side: Side, qty: f64, price: f64, tp: f64, sl: f64 ) -> Self

source

pub fn futures_limit_with_limit_tpsl( symbol: &'a str, side: Side, qty: f64, price: f64, tp: f64, sl: f64 ) -> Self

source

pub fn futures_market(symbol: &'a str, side: Side, qty: f64) -> Self

source

pub fn futures_close_limit( symbol: &'a str, side: Side, qty: f64, price: f64, order_link_id: &'a str ) -> Self

source

pub fn futures_market_close(symbol: &'a str, side: Side, qty: f64) -> Self

Trait Implementations§

source§

impl<'a> Clone for OrderRequest<'a>

source§

fn clone(&self) -> OrderRequest<'a>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<'a> Default for OrderRequest<'a>

source§

fn default() -> OrderRequest<'a>

Returns the “default value” for a type. Read more
source§

impl<'a> Serialize for OrderRequest<'a>

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

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for OrderRequest<'a>

§

impl<'a> Send for OrderRequest<'a>

§

impl<'a> Sync for OrderRequest<'a>

§

impl<'a> Unpin for OrderRequest<'a>

§

impl<'a> UnwindSafe for OrderRequest<'a>

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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