assets | R Documentation |
The assets API serves as the master list of assets available for trade and data consumption from Alpaca. Assets are sorted by asset class, exchange and symbol. Some assets are only available for data consumption via Polygon, and are not tradable with Alpaca. These assets will be marked with the flag tradable = FALSE
. See Assets: GET for details.
assets(...)
... |
|
This function is vectorized over all arguments.
Asset (tibble)
Asset Object or array of Asset objects with the following parameters:
id
(character)
Asset ID as a string.
class
(character)
us_equity as a string.
exchange
(character)
AMEX, ARCA, BATS, NYSE, NASDAQ or NYSEARCA as a string.
symbol
(character)
Stock symbol as a string.
name
(character)
Full company name
status
(character)
active or inactive as a string.
tradable
(logical)
Asset is tradable on Alpaca or not.
marginable
(logical)
Asset is marginable on Alpaca or not.
shortable
(logical)
Asset is shortable on Alpaca or not.
easy_to_borrow
(logical)
Asset is easy-to-borrow or not (filtering for easy_to_borrow = TRUE
is the best way to check whether the name is currently available to short at Alpaca).
@details Errors will be caught and surfaced but the function will always return a (tibble)
to prevent error breaks when retrieving a large vector of assets.
## Not run:
# Get a tibble of all active assets:
assets()
# Get a specific asset by symbol:
(AAPL <- assets("AAPL"))
# or by id:
(AAPL <- assets(AAPL$id))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.