-
Notifications
You must be signed in to change notification settings - Fork 3
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, HashableCodable, Hashable
Account ID.
let id: StringAccount number.
let accountNumber: Stringlet status: AccountStatuslet currency: Currencylet cash: MoneyWhether or not the account has been flagged as a pattern day trader.
let patternDayTrader: BoolUser setting. If true, the account is not allowed to place orders.
let tradeSuspendedByUser: BoolIf true, the account is not allowed to place orders.
let tradingBlocked: BoolIf true, the account is not allowed to request money transfers.
let transfersBlocked: BoolIf true, the account activity by user is prohibited.
let accountBlocked: BoolTimestamp this account was created at.
let createdAt: DateFlag to denote whether or not the account is permitted to short.
let shortingEnabled: BoolReal-time MtM value of all long positions held in the account.
let longMarketValue: MoneyReal-time MtM value of all short positions held in the account.
let shortMarketValue: Moneycash + longMarketValue + shortMarketValue
let equity: MoneyEquity as of previous trading day at 16:00:00 ET.
let lastEquity: MoneyBuying power multiplier that represents account margin classification.
let multiplier: StringValid values:
Current available $ buying power.
let buyingPower: MoneyIf multiplier = 4, this is your daytrade buying power
which is calculated as (lastEquity - (last) maintenanceMargin) * 4;
if multiplier = 2, buyingPower = max(equity – initialMargin,0) * 2;
if multiplier = 1, buyingPower = cash.
Reg T initial margin requirement (continuously updated value).
let initialMargin: MoneyMaintenance margin requirement (continuously updated value).
let maintenanceMargin: MoneyValue of special memorandum account
(will be used at a later date to provide additional buyingPower).
let sma: MoneyThe current number of daytrades that have been made in the last 5 trading days (inclusive of today).
let daytradeCount: QuantityYour maintenance margin requirement on the previous trading day.
let lastMaintenanceMargin: MoneyYour buying power for day trades (continuously updated value).
let daytradingBuyingPower: MoneyYour buying power under Regulation T (your excess equity - equity minus margin value - times your margin multiplier).
let regtBuyingPower: MoneyGenerated at 2020-05-22T00:57:11+0000 using swift-doc 1.0.0-beta.3.
Types
- Account
- AccountStatus
- Alpaca
- Alpaca.Key
- Alpaca.Mode
- Alpaca.Version
- AlpacaAPI
- AlpacaAPI.Path
- AlpacaError
- Asset
- Asset.QueryParameters
- AssetClass
- AssetStatus
- Calendar
- Calendar.QueryParameters
- Cancel
- Clock
- Currency
- Direction
- Exchange
- Money
- Order
- Order.QueryParameters
- OrderCancellation
- OrderClass
- OrderRequest
- OrderSide
- OrderStatus
- OrderStatusFilter
- OrderType
- Position
- PositionLiquidation
- PositionSide
- Quantity
- StopLoss
- TakeProfit
- TimeInForce