Title: | Interface for the RobinHood.com No Commission Investing Platform |
---|---|
Description: | Execute API calls to the RobinHood <https://robinhood.com> investing platform. Functionality includes accessing account data and current holdings, retrieving investment statistics and quotes, placing and canceling orders, getting market trading hours, searching investments by popular tag, and interacting with watch lists. |
Authors: | Joseph Blubaugh |
Maintainer: | Joseph Blubaugh <[email protected]> |
License: | GPL-3 |
Version: | 1.8.0 |
Built: | 2025-03-04 03:47:40 UTC |
Source: | https://github.com/jestonblu/robinhood |
Backend function called by get_user(),'returns a list of user account data.
api_accounts(RH)
api_accounts(RH)
RH |
object of class RobinHood |
Backend function which calls the Nummus API to return the account id.
api_accounts_crypto(RH)
api_accounts_crypto(RH)
RH |
object of class RobinHood |
Backend function for interacting and getting data on linked bank accounts.
api_ach( RH, action, amount = NULL, status_url = NULL, cancel_url = NULL, transfer_url = NULL )
api_ach( RH, action, amount = NULL, status_url = NULL, cancel_url = NULL, transfer_url = NULL )
RH |
object of class RobinHood |
action |
(string) one of "transfers", "relationships", "schedules", "status", "cancel", "deposit", "withdraw" |
amount |
(numeric) amount in dollars you want to deposit or withdraw (NULL if not one of those actions) |
status_url |
(string) URL returned by place_ach_transfer() |
cancel_url |
(string) URL returned by place_ach_transfer() |
transfer_url |
(string) url of your linked account, output of get_ach(RH, "relationships") |
RobinHood API: Option Contract Instruments
api_contracts(RH, chain_symbol, type)
api_contracts(RH, chain_symbol, type)
RH |
object of class RobinHood |
chain_symbol |
(string) a single ticker symbol |
type |
(string) one of call or put |
Returns the ID for a particular paired currency
api_currency_pairs(RH)
api_currency_pairs(RH)
RH |
object of class RobinHood |
Backend function called by almost every function. Returns the appropriate starting URL for a given endpoint.
api_endpoints(endpoint, source = "equity")
api_endpoints(endpoint, source = "equity")
endpoint |
(string) which api endpoint to look up? |
source |
(string) directs api to api.robinhood.com (equity) vs nummus.robinhood.com (crypto) |
Backend function called by get_fundamentals(), watchlist(). Returns a data frame of descriptive data for a given ticker symbol.
api_fundamentals(RH, ticker)
api_fundamentals(RH, ticker)
RH |
object of class RobinHood |
ticker |
(string) vector of ticker symbols |
Backend function called by get_historicals(). Returns a data frame of historical price data.
api_historicals(RH, historicals_url, body)
api_historicals(RH, historicals_url, body)
RH |
object of class RobinHood |
historicals_url |
(string) api url |
body |
(string) api body |
Backend function called by get_historicals_crypto(). Returns a data frame of historical price data.
api_historicals_crypto(RH, url)
api_historicals_crypto(RH, url)
RH |
object of class RobinHood |
url |
(string) full url coming from get_historicals_crypto |
Backend function called by get_historicals_options().
api_historicals_options( RH, chain_symbol, type, strike_price, expiration_date, interval = NULL, span = NULL )
api_historicals_options( RH, chain_symbol, type, strike_price, expiration_date, interval = NULL, span = NULL )
RH |
object of class RobinHood |
chain_symbol |
(string) stock symbol |
type |
(string) one of ("put", "call") |
strike_price |
(numeric) strike price |
expiration_date |
(string) expiration date (YYYY-MM-DD) |
interval |
(string) one of ("5minute", "10minute", "hour", "day", "week") |
span |
(string) one of ("day", "week", "month") |
Backend function called by get_tag(), get_position(), watchlist(). Returns a list of instrument data.
api_instruments(RH, symbol = NULL, instrument_url = NULL)
api_instruments(RH, symbol = NULL, instrument_url = NULL)
RH |
object of class RobinHood |
symbol |
(string) a single symbol |
instrument_url |
(string) instrument url |
Backend function or retrieving option contracts.
api_instruments_options( RH, method = "url", option_instrument_url = NULL, chain_symbol = NULL, type = NULL, state = NULL, strike_price = NULL, tradability = NULL, expiration_date = NULL )
api_instruments_options( RH, method = "url", option_instrument_url = NULL, chain_symbol = NULL, type = NULL, state = NULL, strike_price = NULL, tradability = NULL, expiration_date = NULL )
RH |
object of class RobinHood |
method |
(string) one of ("url", "symbol") |
option_instrument_url |
(string) direct url for an option contract |
chain_symbol |
(string) stock symbol |
type |
(string) one of ("put", "call") |
state |
(string) one of ("active", "inactive") |
strike_price |
(numeric) strike price |
tradability |
(string) one of ("tradable", "untradable") |
expiration_date |
(string) expiration date ("YYYY-MM-DD") |
Backend function called by RobinHood(). Returns a list like object of class RobinHood which stores tokens required by all other functions.
api_login(username, password, mfa_code)
api_login(username, password, mfa_code)
username |
(string) RobinHood username |
password |
(string) RobinHood password |
mfa_code |
(string) Provided by your authentication app |
Backend function called by logout(). Sends a logout call and disables your oauth2 token.
api_logout(RH)
api_logout(RH)
RH |
object of class RobinHood |
Returns a dataframe of quantitative market information for a particular option instrument
api_marketdata(RH, instrument, type = "instrument_id")
api_marketdata(RH, instrument, type = "instrument_id")
RH |
object of class RobinHood |
instrument |
(string) a single instrument_id or multiple instrument_urls |
type |
(string) one of instrument_id or instrument_url |
Backend function called by get_market_hours(). Returns a data frame of markets data and trading hours.
api_markets(RH, markets_url, type = "df")
api_markets(RH, markets_url, type = "df")
RH |
object of class RobinHood |
markets_url |
(string) a single market url |
type |
(string) structure of data returned, 'df' or 'list' |
Backend function called by place_order(), get_order_status(), cancel_order(). Issues a buy/sell order or returns the status of an order. When issuing a buy order use the url column in the return data to check the status or cancel the order.
api_orders( RH, action, status_url = NULL, cancel_url = NULL, instrument_id = NULL, symbol = NULL, type = NULL, time_in_force = NULL, trigger = NULL, price = NULL, stop_price = NULL, quantity = NULL, side = NULL, page_size = NULL )
api_orders( RH, action, status_url = NULL, cancel_url = NULL, instrument_id = NULL, symbol = NULL, type = NULL, time_in_force = NULL, trigger = NULL, price = NULL, stop_price = NULL, quantity = NULL, side = NULL, page_size = NULL )
RH |
object of class RobinHood |
action |
(string) one of "order", "status", "cancel", or "history" |
status_url |
(string) if action = "status", status_url is required (output from place_order()) |
cancel_url |
(string) if action = "cancel", cancel_url is required (output from place_order()) |
instrument_id |
(string) URL of the instrument_id |
symbol |
(string) Ticket symbol you are attempting to buy or sell |
type |
(string) "market" or "limit" |
time_in_force |
(string) Good For Day ("gfd"), Good Till Canceled ("gtc"), Immediate or Cancel ("ioc"), or Opening ("opg") |
trigger |
(string) "immediate" or "stop" |
price |
(number) the price you are willing to sell or buy at |
stop_price |
(number) if trigger = stop, enter stop price, otherwise leave blank |
quantity |
(int) number of shares you wish to transact |
side |
(string) "buy" or "sell" |
page_size |
(int) for get_order_history, refers to the number of historical records to return |
Backend function called by place_order(), get_order_status(), cancel_order(). Issues a buy/sell order or returns the status of an order. When issuing a buy order use the url column in the return data to check the status or cancel the order.
api_orders_crypto( RH, action, order_id = NULL, cancel_url = NULL, currency_pair_id = NULL, type = NULL, time_in_force = NULL, price = NULL, quantity = NULL, side = NULL )
api_orders_crypto( RH, action, order_id = NULL, cancel_url = NULL, currency_pair_id = NULL, type = NULL, time_in_force = NULL, price = NULL, quantity = NULL, side = NULL )
RH |
object of class RobinHood |
action |
(string) one of "order", "status", "cancel", or "history" |
order_id |
(string) action is "status" or "cancel", only order_id is required |
cancel_url |
(string) url for posting a cancel order |
currency_pair_id |
(string) currency pair id |
type |
(string) "market" or "limit" |
time_in_force |
(string) Good For Day ("gfd"), Good Till Canceled ("gtc"), Immediate or Cancel ("ioc"), or Opening ("opg") |
price |
(number) the price you are willing to sell or buy at |
quantity |
(int) number of shares you wish to transact |
side |
(string) "buy" or "sell" |
RobinHood API: Option Orders
api_orders_options( RH, action, status_url = NULL, cancel_url = NULL, quantity = NULL, direction = NULL, stop_price = NULL, type = NULL, time_in_force = NULL, side = NULL, option_id = NULL )
api_orders_options( RH, action, status_url = NULL, cancel_url = NULL, quantity = NULL, direction = NULL, stop_price = NULL, type = NULL, time_in_force = NULL, side = NULL, option_id = NULL )
RH |
object of class RobinHood |
action |
(string) one of "order", "status", "cancel", "history" |
status_url |
(string) if action = "status", status_url is required (output from place_order_options()) |
cancel_url |
(string) if action = "cancel", cancel_url is required (output from place_order_options()) |
quantity |
(int) number of contracts you want to buy |
direction |
(string) one of "debit" or "credit" |
stop_price |
(numeric) stop price on a limit order |
type |
(string) one of "limit" or "market" |
time_in_force |
(string) Good Till Canceled ("gtc"), Immediate or Cancel ("ioc"), or Opening ("opg") |
side |
(string) one of "buy" or "sell" |
option_id |
(string) id column returned by get_contracts() |
Backend function called by get_portfolio(). Returns a data frame of account summaries.
api_portfolios(RH, portfolio_url)
api_portfolios(RH, portfolio_url)
RH |
object of class RobinHood |
portfolio_url |
portfolio url |
Backend function called by get_portfolio(..., source = "crypto"). Returns a data frame of the current crypto portolio summary.
api_portfolios_crypto(RH)
api_portfolios_crypto(RH)
RH |
object of class RobinHood |
Backend function called by get_positions(). Returns a data frame of instrument position data.
api_positions(RH)
api_positions(RH)
RH |
object of class RobinHood |
Backend function called by get_positions(). Returns a data frame of crypto position data via the Nummus api.
api_positions_crypto(RH)
api_positions_crypto(RH)
RH |
object of class RobinHood |
Backend function called by get_positions_options(). Returns a data frame of owned options contracts.
api_positions_options(RH)
api_positions_options(RH)
RH |
object of class RobinHood |
Backend function called by get_positions(), get_quote(), place_order(). Returns a data frame of quote data
api_quote(RH, symbols_url)
api_quote(RH, symbols_url)
RH |
object of class RobinHood |
symbols_url |
(string) url of query with ticker symbols |
Returns a dataframe of current quotes
api_quote_crypto(RH, symbols_url)
api_quote_crypto(RH, symbols_url)
RH |
object of class RobinHood |
symbols_url |
(string) url of query with ticker symbols |
Backend function called by get_ratings() to get analyst rating from RobinHood
api_ratings(RH, symbol)
api_ratings(RH, symbol)
RH |
object of class RobinHood |
symbol |
(string) |
Backend function called by get_tag(). Returns a list of instrument ids.
api_tag(RH, tag)
api_tag(RH, tag)
RH |
object of class RobinHood |
tag |
(string) a hyphenated tag such as "100-most-popular" |
Backend function called by get_ticker. Returns a data frame of all instruments listed on RobinHood.
api_tickers(RH)
api_tickers(RH)
RH |
object of class RobinHood |
Backend function called by get_user() to return user data
api_user(RH)
api_user(RH)
RH |
object of class RobinHood |
Backend function called by watchlist(). Adds or remove instruments from the default watchlist. The create and delete watchlist features are disabled as it appears that the functionality is not currently available on the plateform.
api_watchlist(RH, watchlist_url, detail = FALSE, delete = FALSE)
api_watchlist(RH, watchlist_url, detail = FALSE, delete = FALSE)
RH |
object of class RobinHood |
watchlist_url |
(string) a single watchlist url |
detail |
(logical) if null use header api only, otherwise pass options |
delete |
(logical) send delete call |
Cancel an ACH transfer from your RobinHood account
cancel_ach_transfer(RH, cancel_url)
cancel_ach_transfer(RH, cancel_url)
RH |
object of class RobinHood |
cancel_url |
(string) cancel url returned from initiating a transfer with place_ach_transfer() |
Send a cancel signal for a particular order to RobinHood. You will need to retain the buy/sell order url returned from place_order.
cancel_order(RH, cancel_url)
cancel_order(RH, cancel_url)
RH |
object of class RobinHood |
cancel_url |
(string) cancel url returned from place_order() |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an order, should generate an email confirmation x <- place_order(RH = RH, symbol = "GE", # Ticker symbol you want to trade type = "market", # Type of market order time_in_force = "gfd", # Time period the order is good for (gfd: good for day) trigger = "immediate", # Trigger or delay order price = 8.96, # The highest price you are willing to pay quantity = 1, # Number of shares you want side = "buy") # buy or sell # Cancel the order, should also generate an email confirmation cancel_order(RH, x$cancel_url) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an order, should generate an email confirmation x <- place_order(RH = RH, symbol = "GE", # Ticker symbol you want to trade type = "market", # Type of market order time_in_force = "gfd", # Time period the order is good for (gfd: good for day) trigger = "immediate", # Trigger or delay order price = 8.96, # The highest price you are willing to pay quantity = 1, # Number of shares you want side = "buy") # buy or sell # Cancel the order, should also generate an email confirmation cancel_order(RH, x$cancel_url) ## End(Not run)
Send a cancel signal for a particular order to RobinHood. You will need to retain the buy/sell order url returned from place_order.
cancel_order_crypto(RH, cancel_url)
cancel_order_crypto(RH, cancel_url)
RH |
object of class RobinHood |
cancel_url |
(string) cancel url returned from place_order_crypto() |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an order, should generate an email confirmation x <- place_order_crypto(RH = RH, symbol = "ETC", # Ticker symbol type = "market", # Type of market order (market, limit) time_in_force = "gtc", # Time period (gfd: good for day) price = 1, # The highest price you are willing to pay quantity = 1, # Number of shares you want side = "buy") # buy or sell # Cancel the order, should also generate an email confirmation cancel_order_crypto(RH, x$cancel_url) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an order, should generate an email confirmation x <- place_order_crypto(RH = RH, symbol = "ETC", # Ticker symbol type = "market", # Type of market order (market, limit) time_in_force = "gtc", # Time period (gfd: good for day) price = 1, # The highest price you are willing to pay quantity = 1, # Number of shares you want side = "buy") # buy or sell # Cancel the order, should also generate an email confirmation cancel_order_crypto(RH, x$cancel_url) ## End(Not run)
Send a cancel signal for a particular order to RobinHood. You will need to retain the buy/sell order url returned from place_order_options().
cancel_order_options(RH, cancel_url)
cancel_order_options(RH, cancel_url)
RH |
object of class RobinHood |
cancel_url |
(string) cancel url returned from place_order() |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an order, should generate an email confirmation x <- place_order_options(RH = RH, option_id = "346e46af-380e-4052-a7c2-15748f0fc0ca", direction = "debit", # one of "debit" or "credit" side = "buy", # one of "buy" or "sell" quantity = 1, # number of contracts stop_price = .01, # Time period (gfd: good for day) type = "limit", # limit or market (only limit is currently supported) time_in_force = "gtc") # "gfd", "gtc", "ioc", "opg" # Cancel the order, should also generate an email confirmation cancel_order_options(RH, x$cancel_url) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an order, should generate an email confirmation x <- place_order_options(RH = RH, option_id = "346e46af-380e-4052-a7c2-15748f0fc0ca", direction = "debit", # one of "debit" or "credit" side = "buy", # one of "buy" or "sell" quantity = 1, # number of contracts stop_price = .01, # Time period (gfd: good for day) type = "limit", # limit or market (only limit is currently supported) time_in_force = "gtc") # "gfd", "gtc", "ioc", "opg" # Cancel the order, should also generate an email confirmation cancel_order_options(RH, x$cancel_url) ## End(Not run)
Checks to see if you have a valid RobihHood object
check_rh(RH)
check_rh(RH)
RH |
object of class RobinHood |
Get data related to your RobinHood account
get_accounts(RH)
get_accounts(RH)
RH |
object of class RobinHood |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_accounts(RH) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_accounts(RH) ## End(Not run)
Get ACH data from your RobinHood linked bank accounts
get_ach(RH, action, status_url = NULL)
get_ach(RH, action, status_url = NULL)
RH |
object of class RobinHood |
action |
(string) one of "transfers", "relationships", "schedules", "status" |
status_url |
(string) URL returned by place_ach_transfer() |
Get a option contracts from RobinHood
get_contracts(RH, chain_symbol, type, detail = FALSE)
get_contracts(RH, chain_symbol, type, detail = FALSE)
RH |
object class RobinHood |
chain_symbol |
(string) a single ticket symbol |
type |
(string) one of call or put |
detail |
(logical) if TRUE (default) return additional info on greeks, prevous day, high/low fill rate prices |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_contracts(RH, "IR") ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_contracts(RH, "IR") ## End(Not run)
Get fundamental investment statistics for a particular ticker symbol
get_fundamentals(RH, ticker, include_description = FALSE)
get_fundamentals(RH, ticker, include_description = FALSE)
RH |
object of class RobinHood |
ticker |
(string) vector of ticker symbols |
include_description |
(logical) include a long description of the company (default: FALSE) |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_fundamentals(RH, "CAT") ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_fundamentals(RH, "CAT") ## End(Not run)
Returns a data frame of historical price history for a given symbol.
get_historicals(RH, symbol, interval, span, tz = Sys.timezone())
get_historicals(RH, symbol, interval, span, tz = Sys.timezone())
RH |
object of class RobinHood |
symbol |
(string) Stock symbol to query, single symbol only |
interval |
(string) Interval of time to aggregate to (examples: hour, day, week, month) |
span |
(string) Period of time you are interested in (examples: day, week, month, year) |
tz |
(string) timezone returned by OlsonNames() (eg: "America/Chicago") |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_historicals(RH = RH, symbol = "CAT", interval = "day", span = "month") ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_historicals(RH = RH, symbol = "CAT", interval = "day", span = "month") ## End(Not run)
Returns a data frame of historical crypto price history for a given symbol. Note that not all combinations of interval/span and bounds will return results. Spans that go beyond day (week, month, year) will not return results for certain bounds values (trading, extended). The function should return a message if you specify a combination of inputs that returns no results.
get_historicals_crypto(RH, symbol, interval, span, bounds, tz = Sys.timezone())
get_historicals_crypto(RH, symbol, interval, span, bounds, tz = Sys.timezone())
RH |
object of class RobinHood |
symbol |
(string) ticker symbol of crypto (BTC, ETH, ETC) |
interval |
(string) Interval of time to aggregate to (examples: hour, day, week, month) |
span |
(string) Period of time you are interested in (examples: day, week, month, year) |
bounds |
(string) One of regular (6 hours), trading (9 hours), extended (16 hours), 24_7 |
tz |
(string) timezone returned by OlsonNames() (eg: "America/Chicago") |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_historicals_crypto(RH, symbol = "ETC", interval = "5minute", span = "day", bounds = 'regular') get_historicals_crypto(RH, symbol = "ETC", interval = "5minute", span = "day", bounds = 'trading') get_historicals_crypto(RH, symbol = "ETC", interval = "5minute", span = "day", bounds = 'extended') get_historicals_crypto(RH, symbol = "ETC", interval = "5minute", span = "day", bounds = '24_7') ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_historicals_crypto(RH, symbol = "ETC", interval = "5minute", span = "day", bounds = 'regular') get_historicals_crypto(RH, symbol = "ETC", interval = "5minute", span = "day", bounds = 'trading') get_historicals_crypto(RH, symbol = "ETC", interval = "5minute", span = "day", bounds = 'extended') get_historicals_crypto(RH, symbol = "ETC", interval = "5minute", span = "day", bounds = '24_7') ## End(Not run)
Returns a data frame of historical options for a given symbol, strike price, and expiration date.
get_historicals_options( RH, chain_symbol, type, strike_price, expiration_date, interval = NULL, span = NULL )
get_historicals_options( RH, chain_symbol, type, strike_price, expiration_date, interval = NULL, span = NULL )
RH |
object of class RobinHood |
chain_symbol |
(string) stock symbol |
type |
(string) one of ("put", "call") |
strike_price |
(numeric) strike price |
expiration_date |
(string) expiration date (YYYY-MM-DD) |
interval |
(string) one of ("5minute", "10minute", "hour", "day", "week") |
span |
(string) one of ("day", "week", "month") |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_historicals_options(RH = RH, chain_symbol = "AAPL", interval = "10minute", type = "call", expiration_date = "2021-03-12", strike_price = 122) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_historicals_options(RH = RH, chain_symbol = "AAPL", interval = "10minute", type = "call", expiration_date = "2021-03-12", strike_price = 122) ## End(Not run)
Get a list of markets available on RobinHood with trading hours for a specific date.
get_market_hours(RH, market_date = NULL, tz = Sys.timezone())
get_market_hours(RH, market_date = NULL, tz = Sys.timezone())
RH |
object of class RobinHood |
market_date |
(string) date in the form 'yyyy-mm-dd', default today |
tz |
(string) one of timezone returned by OlsonNames(), defaults to local |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_market_hours(RH) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_market_hours(RH) ## End(Not run)
Download all available order history for your RobinHood account
get_order_history(RH, page_size = 1000)
get_order_history(RH, page_size = 1000)
RH |
object of class RobinHood |
page_size |
(int) number of historical records to fetch |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_order_history(RH) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_order_history(RH) ## End(Not run)
Download all available crypto currency order history for your RobinHood account
get_order_history_crypto(RH)
get_order_history_crypto(RH)
RH |
object of class RobinHood |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_order_history_crypto(RH) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_order_history_crypto(RH) ## End(Not run)
Download all available options order history for your RobinHood account
get_order_history_options(RH)
get_order_history_options(RH)
RH |
object of class RobinHood |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_order_history(RH) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_order_history(RH) ## End(Not run)
Returns a list of order information given a buy/sell order url returned from place_order().
get_order_status(RH, status_url, limit_output = TRUE)
get_order_status(RH, status_url, limit_output = TRUE)
RH |
object of class RobinHood |
status_url |
(string) url of order returned from place_order |
limit_output |
(logical) return limited info on the order (default TRUE) |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an order, should generate an email confirmation x <- place_order(RH = RH, symbol = "GE", # Ticker symbol you want to trade type = "market", # Type of market order time_in_force = "gfd", # Time period the order is good for (gfd: good for day) trigger = "immediate", # Trigger or delay order price = 8.96, # The highest price you are willing to pay quantity = 1, # Number of shares you want side = "buy") # buy or sell get_order_status(RH, x$status_url) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an order, should generate an email confirmation x <- place_order(RH = RH, symbol = "GE", # Ticker symbol you want to trade type = "market", # Type of market order time_in_force = "gfd", # Time period the order is good for (gfd: good for day) trigger = "immediate", # Trigger or delay order price = 8.96, # The highest price you are willing to pay quantity = 1, # Number of shares you want side = "buy") # buy or sell get_order_status(RH, x$status_url) ## End(Not run)
Returns a list of order information given a buy/sell order url returned from place_order().
get_order_status_crypto(RH, order_id)
get_order_status_crypto(RH, order_id)
RH |
object of class RobinHood |
order_id |
(string) id field of the object returned by place_order_crypto |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an order, should generate an email confirmation x <- place_order_crypto(RH = RH, symbol = "GE", # Ticker symbol you want to trade type = "market", # Type of market order time_in_force = "gfd", # Time period (gfd: good for day) trigger = "immediate", # Trigger or delay order price = 8.96, # The highest price you are willing to pay quantity = 1, # Number of shares you want side = "buy") # buy or sell get_order_status_crypto(RH, order_id = x$id) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an order, should generate an email confirmation x <- place_order_crypto(RH = RH, symbol = "GE", # Ticker symbol you want to trade type = "market", # Type of market order time_in_force = "gfd", # Time period (gfd: good for day) trigger = "immediate", # Trigger or delay order price = 8.96, # The highest price you are willing to pay quantity = 1, # Number of shares you want side = "buy") # buy or sell get_order_status_crypto(RH, order_id = x$id) ## End(Not run)
Returns a list of order information given a buy/sell order url returned from place_order_options().
get_order_status_options(RH, status_url)
get_order_status_options(RH, status_url)
RH |
object of class RobinHood |
status_url |
(string) url of order returned from place_order |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an order, should generate an email confirmation x <- place_order_options(RH = RH, option_id = "346e46af-380e-4052-a7c2-15748f0fc0ca", direction = "debit", # one of "debit" or "credit" side = "buy", # one of "buy" or "sell" quantity = 1, # number of contracts stop_price = .01, # Time period (gfd: good for day) type = "limit", # limit or market (only limit is currently supported) time_in_force = "gtc") # "gfd", "gtc", "ioc", "opg" get_order_status_options(RH, x$status_url) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an order, should generate an email confirmation x <- place_order_options(RH = RH, option_id = "346e46af-380e-4052-a7c2-15748f0fc0ca", direction = "debit", # one of "debit" or "credit" side = "buy", # one of "buy" or "sell" quantity = 1, # number of contracts stop_price = .01, # Time period (gfd: good for day) type = "limit", # limit or market (only limit is currently supported) time_in_force = "gtc") # "gfd", "gtc", "ioc", "opg" get_order_status_options(RH, x$status_url) ## End(Not run)
Returns a dataframe of portfolio summaries for a specific period of time. Default is current day.
get_portfolios(RH, interval = NULL, span = NULL)
get_portfolios(RH, interval = NULL, span = NULL)
RH |
object of class RobinHood |
interval |
(string) Interval of time to aggregate to (examples: hour, day, week, month) |
span |
(string) Period of time you are interested in (examples: day, week, month, year) |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_portfolios(RH) get_portfolios(RH, interval = "day", span = "3month") ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_portfolios(RH) get_portfolios(RH, interval = "day", span = "3month") ## End(Not run)
Get the currently held positions for your RobinHood account
get_positions(RH, limit_output = TRUE)
get_positions(RH, limit_output = TRUE)
RH |
object class RobinHood |
limit_output |
(logical) if true, return a simplified positions table, false returns all position details |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_positions(RH) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_positions(RH) ## End(Not run)
Get the currently held crypto positions for your RobinHood account
get_positions_crypto(RH)
get_positions_crypto(RH)
RH |
object class RobinHood |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_positions_crypto(RH) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_positions_crypto(RH) ## End(Not run)
Get the currently held positions for your RobinHood account
get_positions_options(RH, trim_pending = TRUE)
get_positions_options(RH, trim_pending = TRUE)
RH |
object class RobinHood |
trim_pending |
(logical) if FALSE, then return pending and intraday columns |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_positions_options(RH) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_positions_options(RH) ## End(Not run)
Get a quote from RobinHood
get_quote(RH, symbol, limit_output = TRUE)
get_quote(RH, symbol, limit_output = TRUE)
RH |
object class RobinHood |
symbol |
(string) of ticker symbols |
limit_output |
(logical) if TRUE (default) return less quote detail |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_quote(RH, "IR") ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_quote(RH, "IR") ## End(Not run)
Get a crypto currency quote from RobinHood
get_quote_crypto(RH, symbol)
get_quote_crypto(RH, symbol)
RH |
object class RobinHood |
symbol |
(string) cryto currency symbol such as BTC, ETH, DOGE |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_quote_crypto(RH, "BTC") ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_quote_crypto(RH, "BTC") ## End(Not run)
Get analyst raings for a given equity symbol from RobinHood
get_ratings(RH, symbol)
get_ratings(RH, symbol)
RH |
object class RobinHood |
symbol |
(string) Ticker symbol |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_ratings(RH, symbol = "CAT") ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_ratings(RH, symbol = "CAT") ## End(Not run)
Geta a data frame of ticker symbols and names linked to trending tags on the RobinHood website.
get_tag(RH, tag)
get_tag(RH, tag)
RH |
object class RobinHood |
tag |
(string) a hyphenated tag such as "100-most-popular" |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_tag(RH, "100-most-popular") ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_tag(RH, "100-most-popular") ## End(Not run)
Get a dataframe of all listed companies including ticker symbols and tradeability indicators.
get_tickers(RH, add_fundamentals = FALSE)
get_tickers(RH, add_fundamentals = FALSE)
RH |
object of class RobinHood |
add_fundamentals |
(logical) if TRUE then return fundamental data (long run time) |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_tickers(RH) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_tickers(RH) ## End(Not run)
Get personal user data related to your RobinHood account
get_user(RH)
get_user(RH)
RH |
object class RobinHood |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_user(RH) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") get_user(RH) ## End(Not run)
Send a logout call through the RobinHood API service and disable your token.
logout(RH)
logout(RH)
RH |
object of class RobinHood |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") logout(RH) ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") logout(RH) ## End(Not run)
Converts a data frame to json minus the square brackets on the ends
mod_json(x, type)
mod_json(x, type)
x |
dataframe intended for json conversoin |
type |
(string) one of "fromJSON" or "toJSON" |
Place an ACH transfer to and from your RobinHood account
place_ach_transfer(RH, action, amount, transfer_url)
place_ach_transfer(RH, action, amount, transfer_url)
RH |
object of class RobinHood |
action |
(string) one of "deposit", "withdraw" |
amount |
(numeric) amount in dollars you want to deposit or withdraw |
transfer_url |
(string) url of your linked account, output of get_ach(RH, "relationships") |
Place a buy or sell order against your RobinHood account
place_order( RH, symbol, type, time_in_force, trigger, price = NA, stop_price = NA, quantity, side )
place_order( RH, symbol, type, time_in_force, trigger, price = NA, stop_price = NA, quantity, side )
RH |
object of class RobinHood |
symbol |
(string) Ticket symbol you are attempting to buy or sell |
type |
(string) "market" or "limit" |
time_in_force |
(string) Good For Day ("gfd"), Good Till Canceled ("gtc"), Immediate or Cancel ("ioc"), or Opening ("opg") |
trigger |
(string) "immediate" or "stop" |
price |
(number) the price you are willing to sell or buy at (max 2 decimals) (Note: P * Q > 0.01) |
stop_price |
(number) if trigger = stop, enter stop price, otherwise leave blank |
quantity |
(int) number of shares you wish to transact (> 0) (Note: P * Q > 0.01) |
side |
(string) "buy" or "sell" |
## Not run: # ***************** ATTENTION ***************** # - Price cannot extend beyond 2 decimals # - Price * Quantity > $0.01 # - Stop triggers requires stop_price > 0 # ***************** ATTENTION ***************** # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an order, should generate an email confirmation place_order(RH = RH, symbol = "GE", # Ticker symbol you want to trade type = "market", # Type of market order (market, limit) time_in_force = "gfd", # Time period the order is good for (gfd: good for day) trigger = "immediate", # Trigger or delay order price = 8.96, # The highest price you are willing to pay quantity = 1, # Number of shares you want side = "buy") # buy or sell # Stop loss example place_order(RH, symbol="ABC", type = 'market', trigger = 'stop', stop_price = 100, time_in_force = "gtc", # Good till close quantity = 10, side = 'sell') ## End(Not run)
## Not run: # ***************** ATTENTION ***************** # - Price cannot extend beyond 2 decimals # - Price * Quantity > $0.01 # - Stop triggers requires stop_price > 0 # ***************** ATTENTION ***************** # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an order, should generate an email confirmation place_order(RH = RH, symbol = "GE", # Ticker symbol you want to trade type = "market", # Type of market order (market, limit) time_in_force = "gfd", # Time period the order is good for (gfd: good for day) trigger = "immediate", # Trigger or delay order price = 8.96, # The highest price you are willing to pay quantity = 1, # Number of shares you want side = "buy") # buy or sell # Stop loss example place_order(RH, symbol="ABC", type = 'market', trigger = 'stop', stop_price = 100, time_in_force = "gtc", # Good till close quantity = 10, side = 'sell') ## End(Not run)
**Note**: Price and Quantity can both extend beyone 2 decimals **Note**: Price * Quantity > $0.01
place_order_crypto(RH, symbol, type, time_in_force, price, quantity, side)
place_order_crypto(RH, symbol, type, time_in_force, price, quantity, side)
RH |
object of class RobinHood |
symbol |
(string) Ticket symbol you are attempting to buy or sell |
type |
(string) "market" or "limit" |
time_in_force |
(string) Good Till Canceled ("gtc"), Immediate or Cancel ("ioc"), or Opening ("opg") |
price |
(number) the price you are willing to sell or buy at |
quantity |
(number) number of shares you wish to transact |
side |
(string) "buy" or "sell" |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an order, should generate an email confirmation x <- place_order_crypto(RH = RH, symbol = "DOGE", # Ticker symbol type = "market", # Type of market order (market, limit) time_in_force = "gtc", # Time period (gfd: good for day) price = .003, # The highest price you are willing to pay quantity = 500, # Number of shares you want side = "buy") # buy or sell ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an order, should generate an email confirmation x <- place_order_crypto(RH = RH, symbol = "DOGE", # Ticker symbol type = "market", # Type of market order (market, limit) time_in_force = "gtc", # Time period (gfd: good for day) price = .003, # The highest price you are willing to pay quantity = 500, # Number of shares you want side = "buy") # buy or sell ## End(Not run)
Place an order on an option contract. Currently only limit orders are supported so you must supply a price
place_order_options( RH, option_id, direction, side, quantity, stop_price = NULL, type = "limit", time_in_force )
place_order_options( RH, option_id, direction, side, quantity, stop_price = NULL, type = "limit", time_in_force )
RH |
object of class RobinHood |
option_id |
(string) id returned from get_contracts() |
direction |
(string) one of "debit" or "credit" |
side |
(string) one of "buy" or "sell" |
quantity |
(integer) number of contracts to buy |
stop_price |
(numeric) stop price for a limit order |
type |
(string) "limit" or "market" (only limit is currently supported) |
time_in_force |
(string) Good Till Canceled ("gtc"), Immediate or Cancel ("ioc"), or Opening ("opg") |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an options order, should generate an email confirmation x <- place_order_options(RH = RH, option_id = "346e46af-380e-4052-a7c2-15748f0fc0ca", direction = "debit", # one of "debit" or "credit" side = "buy", # one of "buy" or "sell" quantity = 1, # number of contracts stop_price = .01, # Time period (gfd: good for day) type = "limit", # limit or market (only limit is currently supported) time_in_force = "gtc") # "gfd", "gtc", "ioc", "opg" ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Place an options order, should generate an email confirmation x <- place_order_options(RH = RH, option_id = "346e46af-380e-4052-a7c2-15748f0fc0ca", direction = "debit", # one of "debit" or "credit" side = "buy", # one of "buy" or "sell" quantity = 1, # number of contracts stop_price = .01, # Time period (gfd: good for day) type = "limit", # limit or market (only limit is currently supported) time_in_force = "gtc") # "gfd", "gtc", "ioc", "opg" ## End(Not run)
This function returns an object of S3 class RobinHood and establishes a connection to a RobinHood account. It is a required input for every other function in the package.
RobinHood(username, password, mfa_code)
RobinHood(username, password, mfa_code)
username |
(string) account email address |
password |
(string) password |
mfa_code |
(string) mfa_code provided by your authentication app (required if mfa is enabled) |
## Not run: RH <- RobinHood("username", "password") ## End(Not run)
## Not run: RH <- RobinHood("username", "password") ## End(Not run)
Add and delete instruments from your RobinHood watchlist.
watchlist(RH, action, watchlist = "", ticker = "")
watchlist(RH, action, watchlist = "", ticker = "")
RH |
object class RobinHood |
action |
(string) one of: get, add, delete |
watchlist |
(string) name of watchlist to add, delete, or get instruments, null will return a list of watchlist |
ticker |
(string) list of tickers to add or delete, null will add or delete watchlist |
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Get a vector of your watchlist names watchlist(RH, action = "get") # Get a vectors of symbols on your watchlist watchlist(RH, action = "get", watchlist = "Default") # Add a symbol to your watchlist watchlist(RH, action = "add", watchlist = "Default", ticker = "CAT") # Delete a symbol from your watchlist watchlist(RH, action = "delete", watchlist = "Default", ticker = "CAT") ## End(Not run)
## Not run: # Login in to your RobinHood account RH <- RobinHood("username", "password") # Get a vector of your watchlist names watchlist(RH, action = "get") # Get a vectors of symbols on your watchlist watchlist(RH, action = "get", watchlist = "Default") # Add a symbol to your watchlist watchlist(RH, action = "add", watchlist = "Default", ticker = "CAT") # Delete a symbol from your watchlist watchlist(RH, action = "delete", watchlist = "Default", ticker = "CAT") ## End(Not run)