Struct fxoanda::Account

source ·
pub struct Account {
Show 39 fields pub positions: Option<Vec<Position>>, pub trades: Option<Vec<TradeSummary>>, pub resettable_pl_time: Option<DateTime<Utc>>, pub margin_used: Option<f32>, pub margin_closeout_position_value: Option<f32>, pub margin_call_extension_count: Option<i32>, pub currency: Option<String>, pub resettable_pl: Option<f32>, pub nav: Option<f32>, pub last_margin_call_extension_time: Option<DateTime<Utc>>, pub margin_closeout_margin_used: Option<f32>, pub open_trade_count: Option<i32>, pub id: Option<String>, pub open_position_count: Option<i32>, pub margin_closeout_nav: Option<f32>, pub margin_closeout_percent: Option<f32>, pub margin_call_margin_used: Option<f32>, pub commission: Option<f32>, pub hedging_enabled: Option<bool>, pub position_value: Option<f32>, pub pl: Option<f32>, pub guaranteed_stop_loss_order_mode: Option<String>, pub last_transaction_id: Option<String>, pub margin_available: Option<f32>, pub margin_rate: Option<f32>, pub margin_call_percent: Option<f32>, pub margin_call_enter_time: Option<DateTime<Utc>>, pub guaranteed_execution_fees: Option<f32>, pub financing: Option<f32>, pub balance: Option<f32>, pub pending_order_count: Option<i32>, pub withdrawal_limit: Option<f32>, pub unrealized_pl: Option<f32>, pub alias: Option<String>, pub created_by_user_id: Option<i32>, pub margin_closeout_unrealized_pl: Option<f32>, pub created_time: Option<DateTime<Utc>>, pub last_order_fill_timestamp: Option<DateTime<Utc>>, pub orders: Option<Vec<Order>>,
}

Fields§

§positions: Option<Vec<Position>>

The details all Account Positions.

§trades: Option<Vec<TradeSummary>>

The details of the Trades currently open in the Account.

§resettable_pl_time: Option<DateTime<Utc>>

The date/time that the Account’s resettablePL was last reset. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).

§margin_used: Option<f32>

Margin currently used for the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

§margin_closeout_position_value: Option<f32>

The value of the Account’s open positions as used for margin closeout calculations represented in the Account’s home currency. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.

§margin_call_extension_count: Option<i32>

The number of times that the Account’s current margin call was extended.

§currency: Option<String>

The home currency of the Account format: A string containing an ISO 4217 currency (http://en.wikipedia.org/wiki/ISO_4217)

§resettable_pl: Option<f32>

The total realized profit/loss for the Account since it was last reset by the client. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

§nav: Option<f32>

The net asset value of the Account. Equal to Account balance + unrealizedPL. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

§last_margin_call_extension_time: Option<DateTime<Utc>>

The date/time of the Account’s last margin call extension. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).

§margin_closeout_margin_used: Option<f32>

The Account’s margin closeout margin used. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

§open_trade_count: Option<i32>

The number of Trades currently open in the Account.

§id: Option<String>

The Account’s identifier format: “-”-delimited string with format “{siteID}-{divisionID}-{userID}-{accountNumber}”

§open_position_count: Option<i32>

The number of Positions currently open in the Account.

§margin_closeout_nav: Option<f32>

The Account’s margin closeout NAV. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

§margin_closeout_percent: Option<f32>

The Account’s margin closeout percentage. When this value is 1.0 or above the Account is in a margin closeout situation. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.

§margin_call_margin_used: Option<f32>

The Account’s margin call margin used. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

§commission: Option<f32>

The total amount of commission paid over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

§hedging_enabled: Option<bool>

Flag indicating that the Account has hedging enabled.

§position_value: Option<f32>

The value of the Account’s open positions represented in the Account’s home currency. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

§pl: Option<f32>

The total profit/loss realized over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

§guaranteed_stop_loss_order_mode: Option<String>

The current guaranteed Stop Loss Order mode of the Account.

§last_transaction_id: Option<String>

The ID of the last Transaction created for the Account. format: String representation of the numerical OANDA-assigned TransactionID

§margin_available: Option<f32>

Margin available for Account currency. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

§margin_rate: Option<f32>

Client-provided margin rate override for the Account. The effective margin rate of the Account is the lesser of this value and the OANDA margin rate for the Account’s division. This value is only provided if a margin rate override exists for the Account. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.

§margin_call_percent: Option<f32>

The Account’s margin call percentage. When this value is 1.0 or above the Account is in a margin call situation. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.

§margin_call_enter_time: Option<DateTime<Utc>>

The date/time when the Account entered a margin call state. Only provided if the Account is in a margin call. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).

§guaranteed_execution_fees: Option<f32>

The total amount of fees charged over the lifetime of the Account for the execution of guaranteed Stop Loss Orders. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

§financing: Option<f32>

The total amount of financing paid/collected over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

§balance: Option<f32>

The current balance of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

§pending_order_count: Option<i32>

The number of Orders currently pending in the Account.

§withdrawal_limit: Option<f32>

The current WithdrawalLimit for the account which will be zero or a positive value indicating how much can be withdrawn from the account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

§unrealized_pl: Option<f32>

The total unrealized profit/loss for all Trades currently open in the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

§alias: Option<String>

Client-assigned alias for the Account. Only provided if the Account has an alias set

§created_by_user_id: Option<i32>

ID of the user that created the Account.

§margin_closeout_unrealized_pl: Option<f32>

The Account’s margin closeout unrealized PL. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

§created_time: Option<DateTime<Utc>>

The date/time when the Account was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).

§last_order_fill_timestamp: Option<DateTime<Utc>>

The date/time of the last order that was filled for this account. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).

§orders: Option<Vec<Order>>

The details of the Orders currently pending in the Account.

Implementations§

source§

impl Account

source

pub fn new() -> Account

source

pub fn with_positions(self, x: Vec<Position>) -> Account

The details all Account Positions.

  • param Vec
  • return Account
source

pub fn with_trades(self, x: Vec<TradeSummary>) -> Account

The details of the Trades currently open in the Account.

  • param Vec
  • return Account
source

pub fn with_resettable_pl_time(self, x: DateTime<Utc>) -> Account

The date/time that the Account’s resettablePL was last reset. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).

  • param DateTime
  • return Account
source

pub fn with_margin_used(self, x: f32) -> Account

Margin currently used for the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

  • param f32
  • return Account
source

pub fn with_margin_closeout_position_value(self, x: f32) -> Account

The value of the Account’s open positions as used for margin closeout calculations represented in the Account’s home currency. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.

  • param f32
  • return Account
source

pub fn with_margin_call_extension_count(self, x: i32) -> Account

The number of times that the Account’s current margin call was extended.

  • param i32
  • return Account
source

pub fn with_currency(self, x: String) -> Account

The home currency of the Account format: A string containing an ISO 4217 currency (http://en.wikipedia.org/wiki/ISO_4217)

  • param String
  • return Account
source

pub fn with_resettable_pl(self, x: f32) -> Account

The total realized profit/loss for the Account since it was last reset by the client. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

  • param f32
  • return Account
source

pub fn with_nav(self, x: f32) -> Account

The net asset value of the Account. Equal to Account balance + unrealizedPL. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

  • param f32
  • return Account
source

pub fn with_last_margin_call_extension_time(self, x: DateTime<Utc>) -> Account

The date/time of the Account’s last margin call extension. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).

  • param DateTime
  • return Account
source

pub fn with_margin_closeout_margin_used(self, x: f32) -> Account

The Account’s margin closeout margin used. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

  • param f32
  • return Account
source

pub fn with_open_trade_count(self, x: i32) -> Account

The number of Trades currently open in the Account.

  • param i32
  • return Account
source

pub fn with_id(self, x: String) -> Account

The Account’s identifier format: “-”-delimited string with format “{siteID}-{divisionID}-{userID}-{accountNumber}”

  • param String
  • return Account
source

pub fn with_open_position_count(self, x: i32) -> Account

The number of Positions currently open in the Account.

  • param i32
  • return Account
source

pub fn with_margin_closeout_nav(self, x: f32) -> Account

The Account’s margin closeout NAV. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

  • param f32
  • return Account
source

pub fn with_margin_closeout_percent(self, x: f32) -> Account

The Account’s margin closeout percentage. When this value is 1.0 or above the Account is in a margin closeout situation. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.

  • param f32
  • return Account
source

pub fn with_margin_call_margin_used(self, x: f32) -> Account

The Account’s margin call margin used. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

  • param f32
  • return Account
source

pub fn with_commission(self, x: f32) -> Account

The total amount of commission paid over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

  • param f32
  • return Account
source

pub fn with_hedging_enabled(self, x: bool) -> Account

Flag indicating that the Account has hedging enabled.

  • param bool
  • return Account
source

pub fn with_position_value(self, x: f32) -> Account

The value of the Account’s open positions represented in the Account’s home currency. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

  • param f32
  • return Account
source

pub fn with_pl(self, x: f32) -> Account

The total profit/loss realized over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

  • param f32
  • return Account
source

pub fn with_guaranteed_stop_loss_order_mode(self, x: String) -> Account

The current guaranteed Stop Loss Order mode of the Account.

  • param String
  • return Account
source

pub fn with_last_transaction_id(self, x: String) -> Account

The ID of the last Transaction created for the Account. format: String representation of the numerical OANDA-assigned TransactionID

  • param String
  • return Account
source

pub fn with_margin_available(self, x: f32) -> Account

Margin available for Account currency. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

  • param f32
  • return Account
source

pub fn with_margin_rate(self, x: f32) -> Account

Client-provided margin rate override for the Account. The effective margin rate of the Account is the lesser of this value and the OANDA margin rate for the Account’s division. This value is only provided if a margin rate override exists for the Account. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.

  • param f32
  • return Account
source

pub fn with_margin_call_percent(self, x: f32) -> Account

The Account’s margin call percentage. When this value is 1.0 or above the Account is in a margin call situation. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.

  • param f32
  • return Account
source

pub fn with_margin_call_enter_time(self, x: DateTime<Utc>) -> Account

The date/time when the Account entered a margin call state. Only provided if the Account is in a margin call. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).

  • param DateTime
  • return Account
source

pub fn with_guaranteed_execution_fees(self, x: f32) -> Account

The total amount of fees charged over the lifetime of the Account for the execution of guaranteed Stop Loss Orders. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

  • param f32
  • return Account
source

pub fn with_financing(self, x: f32) -> Account

The total amount of financing paid/collected over the lifetime of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

  • param f32
  • return Account
source

pub fn with_balance(self, x: f32) -> Account

The current balance of the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

  • param f32
  • return Account
source

pub fn with_pending_order_count(self, x: i32) -> Account

The number of Orders currently pending in the Account.

  • param i32
  • return Account
source

pub fn with_withdrawal_limit(self, x: f32) -> Account

The current WithdrawalLimit for the account which will be zero or a positive value indicating how much can be withdrawn from the account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

  • param f32
  • return Account
source

pub fn with_unrealized_pl(self, x: f32) -> Account

The total unrealized profit/loss for all Trades currently open in the Account. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

  • param f32
  • return Account
source

pub fn with_alias(self, x: String) -> Account

Client-assigned alias for the Account. Only provided if the Account has an alias set

  • param String
  • return Account
source

pub fn with_created_by_user_id(self, x: i32) -> Account

ID of the user that created the Account.

  • param i32
  • return Account
source

pub fn with_margin_closeout_unrealized_pl(self, x: f32) -> Account

The Account’s margin closeout unrealized PL. format: A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.

  • param f32
  • return Account
source

pub fn with_created_time(self, x: DateTime<Utc>) -> Account

The date/time when the Account was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).

  • param DateTime
  • return Account
source

pub fn with_last_order_fill_timestamp(self, x: DateTime<Utc>) -> Account

The date/time of the last order that was filled for this account. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).

  • param DateTime
  • return Account
source

pub fn with_orders(self, x: Vec<Order>) -> Account

The details of the Orders currently pending in the Account.

  • param Vec
  • return Account

Trait Implementations§

source§

impl Debug for Account

source§

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

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

impl<'de> Deserialize<'de> for Account

source§

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

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

impl Serialize for Account

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

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.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

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