pub struct MarginalIndicatorsData {
pub agreement_data: Option<AgreementData>,
pub portfolio_current_value: Option<PortfolioCurrentValue>,
pub portfolio_stability: Option<PortfolioStability>,
pub forts_stability: Option<FortsStability>,
pub margin_parameters: Option<MarginParameters>,
pub cash_by_currency: Vec<CashByCurrency>,
pub money_debt: Option<MoneyDebtWrapper>,
pub margin_securities: Option<MarginSecuritiesWrapper>,
pub futures_parameters: Option<FuturesParameters>,
}Expand description
A margin indicators frame: the margin picture of the account in one object.
The broker docs describe nine parts. Every part is optional here. Some parts of this library do not
match the docs: the docs name the fields of marginParameters marginValue, collateral,
marginCall and forcedClosure, and give futuresParameters as futuresValue and a
futuresPortfolio list. MarginParameters and FuturesParameters read other names, so they stay
None against a broker that follows the docs. The docs list fortsMarginCall, fortsForcedClosure
and riskLevel for the derivatives stability, which FortsStability does not read either. Not
verified against the live API.
§Examples
use brokapi_bcs_protocol::ws::models::MarginalIndicatorsData;
let m: MarginalIndicatorsData = serde_json::from_str(
r#"{"portfolioCurrentValue":{"currentValueRub":512000.0},"cashByCurrency":[{"currency":"RUB","sum":50000.0}]}"#,
)?;
assert_eq!(m.portfolio_current_value.unwrap().current_value_rub, Some(dec!(512000.0)));
assert_eq!(m.cash_by_currency.len(), 1);Fields§
§agreement_data: Option<AgreementData>Data about the account.
portfolio_current_value: Option<PortfolioCurrentValue>Current value of the portfolio and its changes.
portfolio_stability: Option<PortfolioStability>Stability (margin level) of the portfolio.
forts_stability: Option<FortsStability>Stability of the derivatives market account.
margin_parameters: Option<MarginParameters>Parameters of the margin portfolio. See the note on the type.
cash_by_currency: Vec<CashByCurrency>Free money by currency. Empty if the broker sent none.
money_debt: Option<MoneyDebtWrapper>Debts by currency.
margin_securities: Option<MarginSecuritiesWrapper>Margin positions.
futures_parameters: Option<FuturesParameters>Futures positions. See the note on the type.
Trait Implementations§
Source§impl Clone for MarginalIndicatorsData
impl Clone for MarginalIndicatorsData
Source§fn clone(&self) -> MarginalIndicatorsData
fn clone(&self) -> MarginalIndicatorsData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more