Skip to main content

AccPstnInfo

Struct AccPstnInfo 

Source
pub struct AccPstnInfo {
Show 64 fields pub pstn_id: Option<String>, pub pstn_type: Option<i32>, pub account_market: Option<u32>, pub symbol: Option<String>, pub qty: Option<String>, pub qty_hold: Option<String>, pub qty_avbl: Option<String>, pub diluted_cost: Option<String>, pub average_cost: Option<String>, pub cur_price: Option<String>, pub mv: Option<String>, pub diluted_profit: Option<String>, pub diluted_profit_ratio: Option<String>, pub today_turnover: Option<String>, pub today_buy_qty: Option<String>, pub today_buy_turnover: Option<String>, pub today_buy_avg_price: Option<String>, pub today_sell_qty: Option<String>, pub today_sell_turnover: Option<String>, pub today_sell_avg_price: Option<String>, pub today_profit: Option<String>, pub stock_name: Option<String>, pub ref_close_position_value: Option<String>, pub security_type: Option<u32>, pub currency: Option<u32>, pub unrealized_profit: Option<String>, pub realized_profit: Option<String>, pub sub_pstn_num: Option<u32>, pub exchange_id: Option<u32>, pub from_combo: Option<String>, pub underlying_price: Option<String>, pub average_profit: Option<String>, pub average_profit_ratio: Option<String>, pub im: Option<String>, pub exchange: Option<String>, pub underlying_stock_id: Option<String>, pub expiring_flag: Option<bool>, pub proactive_qty: Option<String>, pub lapse_qty: Option<String>, pub in_the_money_depth: Option<f64>, pub stock_id: Option<String>, pub stock_market: Option<u32>, pub im_ratio: Option<String>, pub mm_ratio: Option<String>, pub cc_matched_quantity: Option<String>, pub spread_matched_quantity: Option<String>, pub straddle_matched_quantity: Option<String>, pub position_ratio: Option<String>, pub mm: Option<String>, pub last_mv: Option<String>, pub cp_matched_quantity: Option<String>, pub strangle_matched_quantity: Option<String>, pub last_profit: Option<String>, pub last_close_price: Option<String>, pub sub_account_id: Option<u64>, pub liquidate_last: Option<u32>, pub open_time: Option<u64>, pub pstn_state: Option<PstnState>, pub open_fill_id: Option<String>, pub business_position_id: Option<String>, pub yesterday_incomes: Option<String>, pub accumulated_incomes: Option<String>, pub shareable: Option<bool>, pub short_name: Option<String>,
}
Expand description

账户单个持仓信息

Fields§

§pstn_id: Option<String>

server保证唯一

§pstn_type: Option<i32>

0->多仓, 1->空仓

§account_market: Option<u32>

账号对应的市场, 取值参考odr_sys_cmn.AccountMarket

§symbol: Option<String>

持仓代码(如果是基金持仓,该字段表示基金的stock_id)

§qty: Option<String>

空仓为负数,若数量为0,则显示 –

§qty_hold: Option<String>

冻结数量

§qty_avbl: Option<String>

可用数量

§diluted_cost: Option<String>

摊薄成本,期货没使用这个字段,若该字段数字无效,svr返回 –

§average_cost: Option<String>

平均成本,也是期货的开仓价,若该字段数字无效,svr返回 –

§cur_price: Option<String>

当前价

§mv: Option<String>

市值

§diluted_profit: Option<String>

摊薄成本盈亏(股票)/收益(基金),当选择使用摊薄成本时使用该字段

§diluted_profit_ratio: Option<String>

摊薄成本盈亏比例(股票)/收益率(基金),当选择使用摊薄成本时使用该字段,若该字段数字无效,svr返回 –

§today_turnover: Option<String>§today_buy_qty: Option<String>§today_buy_turnover: Option<String>§today_buy_avg_price: Option<String>§today_sell_qty: Option<String>§today_sell_turnover: Option<String>§today_sell_avg_price: Option<String>§today_profit: Option<String>§stock_name: Option<String>§ref_close_position_value: Option<String>

砍仓参考额

§security_type: Option<u32>

交易品种 取值参考SecurityType

§currency: Option<u32>

取值参考 Currency

§unrealized_profit: Option<String>

未实现盈亏

§realized_profit: Option<String>

已实现盈亏

§sub_pstn_num: Option<u32>

以下字段目前只有期货用到

期货子持仓个数,该汇总持仓下有几次成交,就有几个子持仓

§exchange_id: Option<u32>

期货所属交易所 market_code:如港股期货:114

§from_combo: Option<String>

期货所属组合代码

§underlying_price: Option<String>

支持underlying price

对应正股的当前价

§average_profit: Option<String>

平均成本盈亏(股票)/收益(基金),当选择使用平均成本时使用该字段

§average_profit_ratio: Option<String>

平均成本盈亏比例(股票)/收益率(基金),当选择使用平均成本时使用该字段

§im: Option<String>

risk oa 使用

初始保证金要求

§exchange: Option<String>

期货所属交易所代码,如HKFE

§underlying_stock_id: Option<String>

衍生品返回对应正股的stock_id,正股返回自己的stock_id

§expiring_flag: Option<bool>

是否临期标志位,期权使用

§proactive_qty: Option<String>

已申请提前行权的有效数量,仅供期权使用

§lapse_qty: Option<String>

已申请放弃行权的有效数量,仅供期权使用

§in_the_money_depth: Option<f64>

价内深度,正时价内,负时价外

§stock_id: Option<String>§stock_market: Option<u32>

持仓对应的市场, 取值参考odr_sys_cmn.StockMarket

§im_ratio: Option<String>

初始保证金率

§mm_ratio: Option<String>

维持保证金率

§cc_matched_quantity: Option<String>

组合CoverdCall的期权张数

§spread_matched_quantity: Option<String>

组合Spread的期权张数

§straddle_matched_quantity: Option<String>

组合Straddle的期权张数

§position_ratio: Option<String>

持仓占比 已弃用

§mm: Option<String>

维持保证金要求

§last_mv: Option<String>

昨日市值

§cp_matched_quantity: Option<String>

组合CoveredPut的期权张数或正股股数

§strangle_matched_quantity: Option<String>

组合Strangle的期权张数

§last_profit: Option<String>

使用夜盘价时 美股持仓在美东20-24点返回昨日盈亏 美股持仓非美东20-24点、非美股持仓,都不返回该字段

昨日盈亏

§last_close_price: Option<String>

昨收价

§sub_account_id: Option<u64>

使用账户协议SubAccount结构体中id字段(acc_info.proto)

§liquidate_last: Option<u32>

最后清算标记,组合暂不支持最后清算。取值枚举见【LIQUIDATE_LAST_STATE】

§open_time: Option<u64>

开仓时间(时间戳)

§pstn_state: Option<PstnState>

持仓状态,具体见PstnState

§open_fill_id: Option<String>

持仓的开仓成交id,对应aas_cmn.proto的real_open_fiil_id

§business_position_id: Option<String>

按成交维度存储的持仓id,对应aas_cmn.proto的position_id,目前用于客户端下单传给交易使用

§yesterday_incomes: Option<String>

100~199号段为基金专用

昨日收益

§accumulated_incomes: Option<String>

累计收益

§shareable: Option<bool>

是否支持分享

§short_name: Option<String>

基金短名称(用于分享页)

Implementations§

Source§

impl AccPstnInfo

Source

pub fn pstn_id(&self) -> &str

Returns the value of pstn_id, or the default value if pstn_id is unset.

Source

pub fn pstn_type(&self) -> i32

Returns the value of pstn_type, or the default value if pstn_type is unset.

Source

pub fn account_market(&self) -> u32

Returns the value of account_market, or the default value if account_market is unset.

Source

pub fn symbol(&self) -> &str

Returns the value of symbol, or the default value if symbol is unset.

Source

pub fn qty(&self) -> &str

Returns the value of qty, or the default value if qty is unset.

Source

pub fn qty_hold(&self) -> &str

Returns the value of qty_hold, or the default value if qty_hold is unset.

Source

pub fn qty_avbl(&self) -> &str

Returns the value of qty_avbl, or the default value if qty_avbl is unset.

Source

pub fn diluted_cost(&self) -> &str

Returns the value of diluted_cost, or the default value if diluted_cost is unset.

Source

pub fn average_cost(&self) -> &str

Returns the value of average_cost, or the default value if average_cost is unset.

Source

pub fn cur_price(&self) -> &str

Returns the value of cur_price, or the default value if cur_price is unset.

Source

pub fn mv(&self) -> &str

Returns the value of mv, or the default value if mv is unset.

Source

pub fn diluted_profit(&self) -> &str

Returns the value of diluted_profit, or the default value if diluted_profit is unset.

Source

pub fn diluted_profit_ratio(&self) -> &str

Returns the value of diluted_profit_ratio, or the default value if diluted_profit_ratio is unset.

Source

pub fn today_turnover(&self) -> &str

Returns the value of today_turnover, or the default value if today_turnover is unset.

Source

pub fn today_buy_qty(&self) -> &str

Returns the value of today_buy_qty, or the default value if today_buy_qty is unset.

Source

pub fn today_buy_turnover(&self) -> &str

Returns the value of today_buy_turnover, or the default value if today_buy_turnover is unset.

Source

pub fn today_buy_avg_price(&self) -> &str

Returns the value of today_buy_avg_price, or the default value if today_buy_avg_price is unset.

Source

pub fn today_sell_qty(&self) -> &str

Returns the value of today_sell_qty, or the default value if today_sell_qty is unset.

Source

pub fn today_sell_turnover(&self) -> &str

Returns the value of today_sell_turnover, or the default value if today_sell_turnover is unset.

Source

pub fn today_sell_avg_price(&self) -> &str

Returns the value of today_sell_avg_price, or the default value if today_sell_avg_price is unset.

Source

pub fn today_profit(&self) -> &str

Returns the value of today_profit, or the default value if today_profit is unset.

Source

pub fn stock_name(&self) -> &str

Returns the value of stock_name, or the default value if stock_name is unset.

Source

pub fn ref_close_position_value(&self) -> &str

Returns the value of ref_close_position_value, or the default value if ref_close_position_value is unset.

Source

pub fn security_type(&self) -> u32

Returns the value of security_type, or the default value if security_type is unset.

Source

pub fn currency(&self) -> u32

Returns the value of currency, or the default value if currency is unset.

Source

pub fn unrealized_profit(&self) -> &str

Returns the value of unrealized_profit, or the default value if unrealized_profit is unset.

Source

pub fn realized_profit(&self) -> &str

Returns the value of realized_profit, or the default value if realized_profit is unset.

Source

pub fn sub_pstn_num(&self) -> u32

Returns the value of sub_pstn_num, or the default value if sub_pstn_num is unset.

Source

pub fn exchange_id(&self) -> u32

Returns the value of exchange_id, or the default value if exchange_id is unset.

Source

pub fn from_combo(&self) -> &str

Returns the value of from_combo, or the default value if from_combo is unset.

Source

pub fn underlying_price(&self) -> &str

Returns the value of underlying_price, or the default value if underlying_price is unset.

Source

pub fn average_profit(&self) -> &str

Returns the value of average_profit, or the default value if average_profit is unset.

Source

pub fn average_profit_ratio(&self) -> &str

Returns the value of average_profit_ratio, or the default value if average_profit_ratio is unset.

Source

pub fn im(&self) -> &str

Returns the value of im, or the default value if im is unset.

Source

pub fn exchange(&self) -> &str

Returns the value of exchange, or the default value if exchange is unset.

Source

pub fn underlying_stock_id(&self) -> &str

Returns the value of underlying_stock_id, or the default value if underlying_stock_id is unset.

Source

pub fn expiring_flag(&self) -> bool

Returns the value of expiring_flag, or the default value if expiring_flag is unset.

Source

pub fn proactive_qty(&self) -> &str

Returns the value of proactive_qty, or the default value if proactive_qty is unset.

Source

pub fn lapse_qty(&self) -> &str

Returns the value of lapse_qty, or the default value if lapse_qty is unset.

Source

pub fn in_the_money_depth(&self) -> f64

Returns the value of in_the_money_depth, or the default value if in_the_money_depth is unset.

Source

pub fn stock_id(&self) -> &str

Returns the value of stock_id, or the default value if stock_id is unset.

Source

pub fn stock_market(&self) -> u32

Returns the value of stock_market, or the default value if stock_market is unset.

Source

pub fn im_ratio(&self) -> &str

Returns the value of im_ratio, or the default value if im_ratio is unset.

Source

pub fn mm_ratio(&self) -> &str

Returns the value of mm_ratio, or the default value if mm_ratio is unset.

Source

pub fn cc_matched_quantity(&self) -> &str

Returns the value of cc_matched_quantity, or the default value if cc_matched_quantity is unset.

Source

pub fn spread_matched_quantity(&self) -> &str

Returns the value of spread_matched_quantity, or the default value if spread_matched_quantity is unset.

Source

pub fn straddle_matched_quantity(&self) -> &str

Returns the value of straddle_matched_quantity, or the default value if straddle_matched_quantity is unset.

Source

pub fn position_ratio(&self) -> &str

Returns the value of position_ratio, or the default value if position_ratio is unset.

Source

pub fn mm(&self) -> &str

Returns the value of mm, or the default value if mm is unset.

Source

pub fn last_mv(&self) -> &str

Returns the value of last_mv, or the default value if last_mv is unset.

Source

pub fn cp_matched_quantity(&self) -> &str

Returns the value of cp_matched_quantity, or the default value if cp_matched_quantity is unset.

Source

pub fn strangle_matched_quantity(&self) -> &str

Returns the value of strangle_matched_quantity, or the default value if strangle_matched_quantity is unset.

Source

pub fn last_profit(&self) -> &str

Returns the value of last_profit, or the default value if last_profit is unset.

Source

pub fn last_close_price(&self) -> &str

Returns the value of last_close_price, or the default value if last_close_price is unset.

Source

pub fn sub_account_id(&self) -> u64

Returns the value of sub_account_id, or the default value if sub_account_id is unset.

Source

pub fn liquidate_last(&self) -> u32

Returns the value of liquidate_last, or the default value if liquidate_last is unset.

Source

pub fn open_time(&self) -> u64

Returns the value of open_time, or the default value if open_time is unset.

Source

pub fn open_fill_id(&self) -> &str

Returns the value of open_fill_id, or the default value if open_fill_id is unset.

Source

pub fn business_position_id(&self) -> &str

Returns the value of business_position_id, or the default value if business_position_id is unset.

Source

pub fn yesterday_incomes(&self) -> &str

Returns the value of yesterday_incomes, or the default value if yesterday_incomes is unset.

Source

pub fn accumulated_incomes(&self) -> &str

Returns the value of accumulated_incomes, or the default value if accumulated_incomes is unset.

Source

pub fn shareable(&self) -> bool

Returns the value of shareable, or the default value if shareable is unset.

Source

pub fn short_name(&self) -> &str

Returns the value of short_name, or the default value if short_name is unset.

Trait Implementations§

Source§

impl Clone for AccPstnInfo

Source§

fn clone(&self) -> AccPstnInfo

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 AccPstnInfo

Source§

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

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

impl Default for AccPstnInfo

Source§

fn default() -> Self

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

impl Message for AccPstnInfo

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for AccPstnInfo

Source§

fn eq(&self, other: &AccPstnInfo) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for AccPstnInfo

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.

§

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.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

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