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
§username: String
§position_id: 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
impl QA_Postions
pub fn new( code: String, user_id: String, username: String, account_cookie: String, portfolio_cookie: String, ) -> Self
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
pub fn get_price_tick(&mut self) -> f64
pub fn margin(&mut self) -> f64
pub fn settle(&mut self)
pub async fn settle_async(&mut self)
pub fn on_price_change(&mut self, price: f64, datetime: String)
pub fn float_profit_long(&mut self) -> f64
pub fn float_profit_short(&mut self) -> f64
pub fn float_profit(&mut self) -> f64
pub fn get_qifi_position(&mut self) -> Position
pub fn position_profit_long(&mut self) -> f64
pub fn position_profit_short(&mut self) -> f64
pub fn position_profit(&mut self) -> f64
pub fn volume_long(&mut self) -> f64
pub fn volume_short(&mut self) -> f64
pub fn volume_long_frozen(&mut self) -> f64
pub fn volume_short_frozen(&mut self) -> f64
pub fn update_pos( &mut self, price: f64, amount: f64, towards: i32, ) -> (f64, f64)
Trait Implementations§
Source§impl Clone for QA_Postions
impl Clone for QA_Postions
Source§fn clone(&self) -> QA_Postions
fn clone(&self) -> QA_Postions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for QA_Postions
impl Debug for QA_Postions
Source§impl<'de> Deserialize<'de> for QA_Postions
impl<'de> Deserialize<'de> for QA_Postions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for QA_Postions
impl RefUnwindSafe for QA_Postions
impl Send for QA_Postions
impl Sync for QA_Postions
impl Unpin for QA_Postions
impl UnwindSafe for QA_Postions
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
Mutably borrows from an owned value. Read more