Skip to content

Commit

Permalink
Add volume support for IEX prices. Closes #12.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisVaughan committed Jul 21, 2020
1 parent 6397ba3 commit fd77a18
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* `riingo_fundamentals_definitions()` for retrieving descriptions of the
various metrics that can be returned by the other fundamentals utilities.

* `riingo_iex_prices()` now returns a `volume` column (#12).

* `riingo_iex_prices()` gained two new arguments. `after_hours` returns pre
and post market data if any is available. `force_fill` will use the most
recent OHLC data for the current time point if none is available.
Expand Down
2 changes: 1 addition & 1 deletion R/url_constructor.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ retrieve_endpoint <- function(type, endpoint) {
"iex" = switch(endpoint,
"quote" = "",
"latest" = "/prices?",
"prices" = "/prices?"),
"prices" = "/prices?columns=open,high,low,close,volume&"),

"tiingo" = switch(endpoint,
"meta" = "",
Expand Down
5 changes: 3 additions & 2 deletions tests/testthat/test-prices.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ test_that("riingo iex prices - can be pulled", {
prices <- riingo_iex_prices("AAPL")

expect_is(prices, "tbl_df")
expect_equal(ncol(prices), 6) # structurally should always have 6 cols
expect_equal(ncol(prices), 7) # structurally should always have 6 cols
expect_true("volume" %in% names(prices))
})

test_that("riingo iex prices - start date / end date args work", {
Expand Down Expand Up @@ -192,7 +193,7 @@ test_that("riingo iex prices - handles partial successes", {

expect_is(x, "tbl_df")
expect_equal(x$ticker[1], "AAPL")
expect_equal(ncol(x), 6)
expect_equal(ncol(x), 7)
})

# ------------------------------------------------------------------------------
Expand Down

0 comments on commit fd77a18

Please sign in to comment.