NAME

Finance::Robinhood::Equity::Instrument - Represents a Single Equity Instrument

SYNOPSIS

use Finance::Robinhood;
my $rh = Finance::Robinhood->new;
my $instruments = $rh->instruments();

for my $instrument ($instruments->all) {
    CORE::say $instrument->symbol;
}

METHODS

bloomberg_unique( )

https://en.wikipedia.org/wiki/Financial_Instrument_Global_Identifier

country( )

Country code of location of headquarters.

day_trade_ratio( )

id( )

Instrument id used by RH to refer to this particular instrument.

list_date( )

Returns a Time::Moment object containing the date the instrument began trading publically.

maintenance_ratio( )

margin_initial_ratio( )

min_tick_size( )

If applicable, this returns the regulatory defined tick size. See http://www.finra.org/industry/tick-size-pilot-program

name( )

Full name of the instrument.

rhs_tradability( )

Indicates whether the instrument can be traded specifically on Robinhood. Returns tradable or untradable.

simple_name( )

Shorter name for the instrument. Best suited for display.

state( )

Indicates whether this instrument is active or inactive.

symbol( )

Ticker symbol.

tradability( )

Indicates whether or not this instrument can be traded in general. Returns tradable or untradable.

tradable_chain_id( )

Id for the related options chain as a UUID.

tradeable( )

Returns a boolean value.

type( )

Indicates what sort of instrument this is. May one one of these: stock, adr, cef, reit, or etp.

quote( )

my $quote = $instrument->quote();

Builds a Finance::Robinhood::Equity::Quote object with this instrument's quote data.

You do not need to be logged in for this to work.

prices( [...] )

my $prices = $instrument->prices;

Builds a Finance::Robinhood::Equity::Prices object with the instrument's price data. You must be logged in for this to work.

You may modify the type of information returned with the following options:

delayed - Boolean value. If false, real time quote data is returned.
source - You may specify consolidated (which is the default) for data from the tape or nls for the Nasdaq last sale price.
$prices = $instrument->prices(source => 'consolidated', dealyed => 0);

This would return live quote data from the tape.

splits( )

my @splits = $instrument->splits->all;

Returns an iterator with Finance::Robinhood::Equity::Split objects.

market( )

my $market = $instrument->market();

Builds a Finance::Robinhood::Equity::Market object with this instrument's quote data.

You do not need to be logged in for this to work.

fundamentals( )

my $fundamentals = $instrument->fundamentals();

Builds a Finance::Robinhood::Equity::Fundamentals object with this instrument's data.

You do not need to be logged in for this to work.

ratings( )

my $fundamentals = $instrument->ratings();

Builds a Finance::Robinhood::Equity::Ratings object with this instrument's data.

options_chains( )

$instrument = $rh->search('MSFT')->equity_instruments->[0];
my $chains = $instrument->options_chains;

Returns an iterator containing chain elements.

news( )

my $news = $instrument->news;

Returns an iterator containing Finance::Robinhood::News elements.

tags( )

my $tags = $instrument->tags( );

Locates an instrument's tags and returns a list of Finance::Robinhood::Equity::Tag objects.

buy( ... )

my $order = $instrument->buy(34);

Returns a Finance::Robinhood::Equity::OrderBuilder object.

Without any additional method calls, this will create an order that looks like this:

{
   account       => "https://api.robinhood.com/accounts/XXXXXXXXXX/",
   instrument    => "https://api.robinhood.com/instruments/50810c35-d215-4866-9758-0ada4ac79ffa/",
   price         => "111.700000", # Automatically grabs last trade price quote on submission
   quantity      => 4, # Actually the number of shares you requested
   side          => "buy",
   symbol        => "MSFT",
   time_in_force => "gfd",
   trigger       => "immediate",
   type          => "market"
 }

sell( ... )

my $order = $instrument->sell(34);

Returns a Finance::Robinhood::Equity::OrderBuilder object.

Without any additional method calls, this will create an order that looks like this:

{
   account       => "https://api.robinhood.com/accounts/XXXXXXXXXX/",
   instrument    => "https://api.robinhood.com/instruments/50810c35-d215-4866-9758-0ada4ac79ffa/",
   price         => "111.700000", # Automatically grabs last trade price quote on submission
   quantity      => 4, # Actually the number of shares you requested
   side          => "sell",
   symbol        => "MSFT",
   time_in_force => "gfd",
   trigger       => "immediate",
   type          => "market"
 }

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. This software is not affiliated with Robinhood Financial LLC in any way.

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

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>