[][src]Struct alpaca_finance::Account

pub struct Account {
    pub id: String,
    pub number: String,
    pub cash: f64,
    pub equity: f64,
    pub long_market_value: f64,
    pub short_market_value: f64,
    pub buying_power: f64,
    pub created: DateTime<Utc>,
    pub is_account_blocked: bool,
    pub is_pattern_day_trader: bool,
    pub is_trade_suspended: bool,
    pub is_trading_blocked: bool,
    pub is_transfers_blocked: bool,
    pub status: AccountStatus,
}

Important information related to an account.

Including account status, funds available for trade, funds available for withdrawal, and various flags relevant to an account’s ability to trade.

An account maybe be blocked for just for trades (trades_blocked flag) or for both trades and transfers (account_blocked flag) if Alpaca identifies the account to engaging in any suspicious activity.

Also, in accordance with FINRA’s pattern day trading rule, an account may be flagged for pattern day trading (pattern_day_trader flag), which would inhibit an account from placing any further day-trades.

Fields

id: String

Account ID - a UUID

number: String

Account number - a string different from the account ID

cash: f64

Cash balance

equity: f64

The total equity in the account = cash + long_market_value + short_market_value

long_market_value: f64

Real-time MtM value of all long positions held in the account

short_market_value: f64

Real-time MtM value of all short positions held in the account

buying_power: f64

Current available $ buying power

created: DateTime<Utc>

Timestamp this account was created at

is_account_blocked: bool

If true, the account activity by user is prohibited.

is_pattern_day_trader: bool

If true, the account has been flagged as a pattern day trader

is_trade_suspended: bool

If true, the account is not allowed to place orders due to customer request.

is_trading_blocked: bool

If true, the account is not allowed to place orders.

is_transfers_blocked: bool

If true, the account is not allowed to request money transfers.

status: AccountStatus

Account status

Implementations

impl Account[src]

pub async fn get<'_>(alpaca: &'_ Alpaca) -> Result<Account>[src]

Gets the current account information

Example

To get your current account information:

let alpaca = Alpaca::live("KEY_ID", "SECRET").await.unwrap();

let account = Account::get(&alpaca).await.unwrap();

Trait Implementations

impl Debug for Account[src]

impl<'de> Deserialize<'de> for Account[src]

Auto Trait Implementations

impl RefUnwindSafe for Account

impl Send for Account

impl Sync for Account

impl Unpin for Account

impl UnwindSafe for Account

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,