Skip to content
This repository was archived by the owner on Jan 17, 2024. It is now read-only.

Account

hallee edited this page May 10, 2020 · 1 revision

Account

The Alpaca account API serves 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.

public struct Account: Codable, Hashable

Inheritance

Codable, Hashable

Properties

id

Account ID.

let id: String

accountNumber

Account number.

let accountNumber: String

status

let status: AccountStatus

currency

let currency: Currency

cash

let cash: Money

patternDayTrader

Whether or not the account has been flagged as a pattern day trader.

let patternDayTrader: Bool

tradeSuspendedByUser

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

let tradeSuspendedByUser: Bool

tradingBlocked

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

let tradingBlocked: Bool

transfersBlocked

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

let transfersBlocked: Bool

accountBlocked

If true, the account activity by user is prohibited.

let accountBlocked: Bool

createdAt

Timestamp this account was created at.

let createdAt: Date

shortingEnabled

Flag to denote whether or not the account is permitted to short.

let shortingEnabled: Bool

longMarketValue

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

let longMarketValue: Money

shortMarketValue

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

let shortMarketValue: Money

equity

cash + longMarketValue + shortMarketValue

let equity: Money

lastEquity

Equity as of previous trading day at 16:00:00 ET.

let lastEquity: Money

multiplier

Buying power multiplier that represents account margin classification.

let multiplier: String

Valid values:

buyingPower

Current available $ buying power.

let buyingPower: Money

If multiplier = 4, this is your daytrade buying power which is calculated as (lastEquity - (last) maintenanceMargin) * 4; if multiplier = 2, buyingPower = max(equityinitialMargin,0) * 2; if multiplier = 1, buyingPower = cash.

initialMargin

Reg T initial margin requirement (continuously updated value).

let initialMargin: Money

maintenanceMargin

Maintenance margin requirement (continuously updated value).

let maintenanceMargin: Money

sma

Value of special memorandum account (will be used at a later date to provide additional buyingPower).

let sma: Money

daytradeCount

The current number of daytrades that have been made in the last 5 trading days (inclusive of today).

let daytradeCount: Quantity

lastMaintenanceMargin

Your maintenance margin requirement on the previous trading day.

let lastMaintenanceMargin: Money

daytradingBuyingPower

Your buying power for day trades (continuously updated value).

let daytradingBuyingPower: Money

regtBuyingPower

Your buying power under Regulation T (your excess equity - equity minus margin value - times your margin multiplier).

let regtBuyingPower: Money
Clone this wiki locally