30 Apr 2021 22:56:50 UTC
- Distribution: Finance-Alpaca
- Module version: 0.9902
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (44 / 57 / 10)
- KwaliteeBus factor: 1
- 80.44% Coverage
- License: artistic_2
- Perl: v5.22.0
- Activity24 month
- Download (39.39KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionSANKO Sanko Robinson
Finance::Alpaca::Struct::Account - A Single Account Object
use Finance::Alpaca; my $acct = Finance::Alpaca->new( ... )->account; say sprintf 'I can%s short!', $acct->shorting_enabled ? '' : 'not';
The 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. 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.
The following properties are contained in the object.
account_number- Account number
status- See Account Status
currency- String (USD)
cash- Cash balance
pattern_day_trader- Boolean indicating whether or not the account has been flagged as a pattern day trader
trade_suspended_by_user- Boolean indicating whether the account is allowed to place orders (Defined by the user)
trading_blocked- Boolean indicating whether the account is allowed to place orders (Defined by the system)
account_blocked- Boolean indicating the account activity by the user is prohibited
created_at- Timestamp this account was created at
shorting_enabled- Boolean indicating whether or not the account is permitted to short
long_market_value- Real-time MtM value of all long positions held in the account
short_market_value- Real-time MtM value of all short positions held in the account
equity- Cash + long_market_value + short_market_value
last_equity- Equity as of previous trading day at 16:00:00 ET
multiplier- Buying power multiplier that represents account margin classification; valid values 1 (standard limited margin account with 1x buying power), 2 (reg T margin account with 2x intraday and overnight buying power; this is the default for all non-PDT accounts with $2,000 or more equity), 4 (PDT account with 4x intraday buying power and 2x reg T overnight buying power)
buying_power- Current available $ buying power; If multiplier = 4, this is your daytrade buying power which is calculated as (last_equity - (last) maintenance_margin) * 4; If multiplier = 2, buying_power = max(equity – initial_margin,0) * 2; If multiplier = 1, buying_power = cash
initial_margin- Reg T initial margin requirement (continuously updated value)
maintenance_margin- Maintenance margin requirement (continuously updated value)
sma- Value of special memorandum account (will be used at a later date to provide additional buying_power)
daytrade_count- The current number of daytrades that have been made in the last five trading days (inclusive of today)
last_maintenance_margin- Your maintenance margin requirement on the previous trading day
daytrading_buying_power- Your buying power for day trades (continuously updated value)
regt_buying_power- Your buying power under Regulation T (your excess equity - equity - margin value * your margin multiplier)
The following are the possible account status values. Most likely, the account status is
ACTIVEunless there is any problem. The account status may get in
ACCOUNT_UPDATEDwhen personal information is being updated from the dashboard, in which case you may not be allowed trading for a short period of time until the change is approved.
ONBOARDING- The account is onboarding.
SUBMISSION_FAILED- The account application submission failed for some reason.
SUBMITTED- The account application has been submitted for review.
ACCOUNT_UPDATED- The account information is being updated.
APPROVAL_PENDING- The final account approval is pending.
ACTIVE- The account is active for trading.
REJECTED- The account application has been rejected.
Copyright (C) Sanko Robinson.
This library is free software; you can redistribute it and/or modify it under the terms found in the Artistic License 2. Other copyrights, terms, and conditions may apply to data transmitted through this module.
Sanko Robinson <firstname.lastname@example.org>
Module Install Instructions
To install Finance::Alpaca, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Finance::Alpaca
For more information on module installation, please visit the detailed CPAN module installation guide.