The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Finance::Robinhood::Account - Single Robinhood Trade Account

SYNOPSIS

    use Finance::Robinhood;

    my $rh = Finance::Robinhood->new( token => ... );
    my $account = $rh->accounts()->{results}[0];

DESCRIPTION

This class represents a single account. Objects are usually created by Finance::Robinhood's accounts( ... ) method rather than directly.

METHODS

This class has several getters and a few methods as follows...

portfolio( )

Gets a quick rundown of the account's financial standing. Results are returned as a hash with the following keys:

    adjusted_equity_previous_close      Total balance as of previous close +/- after hours trading
    equity                              Total balance
    equity_previous_close               Total balance as of previous close
    excess_margin
    extended_hours_equity               Total valance including after hours trading
    extended_hours_market_value         Market value of securities including after hours trading
    last_core_equity                    Total balance
    last_core_market_value              Market value of securities
    market_value                        Marekt value of securities

historicals( ... )

    $account->historicals( '5minute', 'day' );

Returns historical data about your portfolio. The first argument is an interval time and must be either 5minute, 10minute, day, or week.

The second argument is a span of time indicating how far into the past you would like to retrieve and may be one of the following: day, week, year, or 5year.

Results are returned as a hash with the following keys:

equity_historicals - List of hashes which contain the following keys:
adjusted_close_equity
adjusted_open_equity
begins_at
close_equity
close_market_value
net_return
open_equity
open_market_value
total_return - The total ratio of returns for the span

positions( ... )

    my @positions = $account->positions( );

Returns a paginated list of all securities this account has ever owned. The results are blessed Finance::Robinhood::Position objects.

    my $positions = $account->positions( {cursor => ...} )

Paginated list of positions is continued.

    my $positions = $account->positions( {nonzero => 1} )

Returns a paginated list of securities currently owned by this account. This is likely what you want.

account_number( )

    my $acct = $account->account_number();

Returns the alphanumeric string Robinhood uses to identify this particular account. Keep this secret!

buying_power( )

Total amount of money you currently have for buying shares of securities.

This is not a total amount of cash as it does not include unsettled funds.

cash( )

Total amount of money on hand. This includes unsettled funds and cash on hand.

cash_available_for_withdrawal( )

Amount of money on hand you may withdrawal to an associated bank account.

cash_held_for_orders( )

Amount of money currently marked for active buy orders.

deactivated( )

If the account is deactivated for any reason, this will be a true value.

deposit_halted( )

If an attempt to deposit funds to Robinhood fails, I imagine this boolean value would be true.

margin_balances( )

For margin accounts (Robinhood Instant), this is the amount of funds you have access to.

max_ach_early_access_amount( )

Robinhood Instant accounts have early access to a defined amount of money before the actual transfer has cleared.

only_position_closing_trades( )

Boolean value.

sma( )

Simple moving average of funds.

sms_held_for_orders( )

Simple moving average for cash held for outstanding orders.

sweep_enabled( )

Alternative markets?

type( )

Basic Robinhood accounts are cash accounts while Robinhood Instant accounts would be margin.

Note: ...I would imagine, not having Instant yet.

uncleared_deposits( )

When a deposit is initiated but has not be completed, the amount is added here.

unsettled_funds( )

The amount of money from sell orders which has not settled (see T+3 rule).

updated_at( )

Time::Piece or DateTime object marking the last time the account was changed.

withdrawal_halted( )

Boolean value.

LEGAL

This is a simple wrapper around the API used in the official apps. The author provides no investment, legal, or tax advice and is not responsible for any damages incurred while using this software. Neither this software nor its author are affiliated with Robinhood Financial LLC in any way.

For Robinhood's terms and disclosures, please see their website at http://robinhood.com/

LICENSE

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. Please refer to the LEGAL section.

AUTHOR

Sanko Robinson <sanko@cpan.org>