QA_Postions

Struct QA_Postions 

Source
pub struct QA_Postions {
Show 35 fields pub preset: CodePreset, pub code: String, pub instrument_id: String, pub user_id: String, pub portfolio_cookie: String, pub username: String, pub position_id: String, pub account_cookie: String, pub frozen: f64, pub name: String, pub spms_id: String, pub oms_id: String, pub market_type: String, pub exchange_id: String, pub lastupdatetime: String, pub volume_long_today: f64, pub volume_long_his: f64, pub volume_short_today: f64, pub volume_short_his: f64, pub volume_long_frozen_today: f64, pub volume_long_frozen_his: f64, pub volume_short_frozen_today: f64, pub volume_short_frozen_his: f64, pub margin_long: f64, pub margin_short: f64, pub position_price_long: f64, pub position_cost_long: f64, pub position_price_short: f64, pub position_cost_short: f64, pub open_price_long: f64, pub open_cost_long: f64, pub open_price_short: f64, pub open_cost_short: f64, pub lastest_price: f64, pub lastest_datetime: String,
}

Fields§

§preset: CodePreset§code: String§instrument_id: String§user_id: String§portfolio_cookie: String§username: String§position_id: String§account_cookie: String§frozen: f64§name: String§spms_id: String§oms_id: String§market_type: String§exchange_id: String§lastupdatetime: String§volume_long_today: f64§volume_long_his: f64§volume_short_today: f64§volume_short_his: f64§volume_long_frozen_today: f64§volume_long_frozen_his: f64§volume_short_frozen_today: f64§volume_short_frozen_his: f64§margin_long: f64§margin_short: f64§position_price_long: f64§position_cost_long: f64§position_price_short: f64§position_cost_short: f64§open_price_long: f64§open_cost_long: f64§open_price_short: f64§open_cost_short: f64§lastest_price: f64§lastest_datetime: String

Implementations§

Source§

impl QA_Postions

Source

pub fn new( code: String, user_id: String, username: String, account_cookie: String, portfolio_cookie: String, ) -> Self

Source

pub fn new_with_inithold( code: String, user_id: String, username: String, account_cookie: String, portfolio_cookie: String, volume_long_today: f64, volume_long_his: f64, volume_short_today: f64, volume_short_his: f64, open_price_long: f64, open_price_short: f64, ) -> Self

Source

pub fn get_price_tick(&mut self) -> f64

Source

pub fn margin(&mut self) -> f64

Source

pub fn settle(&mut self)

Source

pub async fn settle_async(&mut self)

Source

pub fn on_price_change(&mut self, price: f64, datetime: String)

Source

pub fn float_profit_long(&mut self) -> f64

Source

pub fn float_profit_short(&mut self) -> f64

Source

pub fn float_profit(&mut self) -> f64

Source

pub fn get_qifi_position(&mut self) -> Position

Source

pub fn position_profit_long(&mut self) -> f64

Source

pub fn position_profit_short(&mut self) -> f64

Source

pub fn position_profit(&mut self) -> f64

Source

pub fn volume_long(&mut self) -> f64

Source

pub fn volume_short(&mut self) -> f64

Source

pub fn volume_long_frozen(&mut self) -> f64

Source

pub fn volume_short_frozen(&mut self) -> f64

Source

pub fn update_pos( &mut self, price: f64, amount: f64, towards: i32, ) -> (f64, f64)

Trait Implementations§

Source§

impl Clone for QA_Postions

Source§

fn clone(&self) -> QA_Postions

Returns a duplicate 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 Debug for QA_Postions

Source§

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

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

impl<'de> Deserialize<'de> for QA_Postions

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for QA_Postions

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§

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, 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> 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,