pub struct QA_Account {Show 14 fields
pub events: HashMap<String, String>,
pub accounts: account,
pub cash: Vec<f64>,
pub money: f64,
pub trades: HashMap<String, QATransaction>,
pub hold: HashMap<String, QA_Postions>,
pub frozen: HashMap<String, QA_Frozen>,
pub dailyassets: HashMap<String, QAAccountSlice>,
pub history: Vec<QATransaction>,
pub account_cookie: String,
pub portfolio_cookie: String,
pub user_cookie: String,
pub dailytrades: BTreeMap<String, Trade>,
pub dailyorders: BTreeMap<String, Order>,
/* private fields */
}
Fields§
§events: HashMap<String, String>
§accounts: account
§cash: Vec<f64>
§money: f64
§trades: HashMap<String, QATransaction>
§hold: HashMap<String, QA_Postions>
§frozen: HashMap<String, QA_Frozen>
§dailyassets: HashMap<String, QAAccountSlice>
§history: Vec<QATransaction>
§dailytrades: BTreeMap<String, Trade>
§dailyorders: BTreeMap<String, Order>
Implementations§
Source§impl QA_Account
impl QA_Account
pub fn new( account_cookie: &str, portfolio_cookie: &str, user_cookie: &str, init_cash: f64, auto_reload: bool, environment: &str, ) -> Self
pub fn new_from_qifi(message: QIFI) -> Self
pub fn init_h(&mut self, code: &str)
pub fn reload(&mut self)
pub fn get_cash(&mut self) -> f64
pub fn get_riskratio(&mut self) -> f64
pub fn get_mom_slice(&mut self) -> QAMOMSlice
Sourcepub fn get_qifi_slice(&mut self) -> QIFI
pub fn get_qifi_slice(&mut self) -> QIFI
创建QIFI的账户切片, 注意他是一个结构体
pub fn get_accountmessage(&mut self) -> Account
Sourcepub fn get_position(&mut self, code: &str) -> Option<&mut QA_Postions>
pub fn get_position(&mut self, code: &str) -> Option<&mut QA_Postions>
positions about
a fast way to get the realtime price/cost/volume/history
pub fn get_volume_long(&mut self, code: &str) -> f64
pub fn get_volume_short(&mut self, code: &str) -> f64
pub fn get_open_price_long(&mut self, code: &str) -> f64
pub fn get_open_price_short(&mut self, code: &str) -> f64
Sourcepub fn get_frozen(&mut self, code: &str) -> f64
pub fn get_frozen(&mut self, code: &str) -> f64
frozen & margin
pub fn get_margin(&mut self) -> f64
Sourcepub fn get_floatprofit(&mut self) -> f64
pub fn get_floatprofit(&mut self) -> f64
profit
pub fn get_positionprofit(&mut self) -> f64
Sourcepub fn get_balance(&mut self) -> f64
pub fn get_balance(&mut self) -> f64
balance
pub async fn settle_async(&mut self)
pub fn settle(&mut self)
pub fn get_codeSubscribed(&mut self) -> Vec<String>
pub fn get_slice(&mut self) -> QAAccountSlice
pub fn get_account_info(&mut self) -> account_info
pub fn get_latest_info(&mut self) -> String
Sourcepub fn history_table(&self)
pub fn history_table(&self)
history about
pub fn to_csv(&self) -> Result<(), Box<dyn Error>>
Sourcepub fn buy(
&mut self,
code: &str,
amount: f64,
time: &str,
price: f64,
) -> Result<QAOrder, ()>
pub fn buy( &mut self, code: &str, amount: f64, time: &str, price: f64, ) -> Result<QAOrder, ()>
order about buy| sell| buy_open| sell_open| buy_close| sell_close| send_order
pub fn sell( &mut self, code: &str, amount: f64, time: &str, price: f64, ) -> Result<QAOrder, ()>
pub fn buy_open( &mut self, code: &str, amount: f64, time: &str, price: f64, ) -> Result<QAOrder, ()>
pub fn sell_open( &mut self, code: &str, amount: f64, time: &str, price: f64, ) -> Result<QAOrder, ()>
pub fn buy_close( &mut self, code: &str, amount: f64, time: &str, price: f64, ) -> Result<QAOrder, ()>
pub fn sell_close( &mut self, code: &str, amount: f64, time: &str, price: f64, ) -> Result<QAOrder, ()>
pub fn buy_closetoday( &mut self, code: &str, amount: f64, time: &str, price: f64, ) -> Result<QAOrder, ()>
pub fn sell_closetoday( &mut self, code: &str, amount: f64, time: &str, price: f64, ) -> Result<QAOrder, ()>
pub fn get_tradingday(&mut self) -> String
pub async fn send_order_async( &mut self, code: &str, amount: f64, time: &str, towards: i32, price: f64, order_id: &str, ) -> Option<QAOrder>
pub fn send_order( &mut self, code: &str, amount: f64, time: &str, towards: i32, price: f64, order_id: &str, ) -> Result<QAOrder, ()>
pub fn on_price_change(&mut self, code: String, price: f64, datetime: String)
pub fn change_datetime(&mut self, datetime: String)
pub fn set_init_cash(&mut self, cash: f64)
Sourcepub fn get_direction_or_offset(&mut self, towards: i32) -> (String, String)
pub fn get_direction_or_offset(&mut self, towards: i32) -> (String, String)
获取成交单方向信息的API, 支持股票与期货
Trait Implementations§
Source§impl Clone for QA_Account
impl Clone for QA_Account
Source§fn clone(&self) -> QA_Account
fn clone(&self) -> QA_Account
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 moreAuto Trait Implementations§
impl Freeze for QA_Account
impl RefUnwindSafe for QA_Account
impl Send for QA_Account
impl Sync for QA_Account
impl Unpin for QA_Account
impl UnwindSafe for QA_Account
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