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->id()
id
account_number
status
currency
cash
pattern_day_trader
trade_suspended_by_user
trading_blocked
account_blocked
created_at
shorting_enabled
long_market_value
short_market_value
equity
last_equity
multiplier
buying_power
initial_margin
maintenance_margin
sma
daytrade_count
last_maintenance_margin
daytrading_buying_power
regt_buying_power
The following are the possible account status values. Most likely, the account status is ACTIVE unless there is any problem. The account status may get in ACCOUNT_UPDATED when 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.
ACTIVE
ACCOUNT_UPDATED
ONBOARDING
SUBMISSION_FAILED
SUBMITTED
APPROVAL_PENDING
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 <sanko@cpan.org>
To install Finance::Alpaca, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Finance::Alpaca
CPAN shell
perl -MCPAN -e shell install Finance::Alpaca
For more information on module installation, please visit the detailed CPAN module installation guide.