-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Error in get_historicals_options #160
Comments
Did some of my own investigation and it looks like the starting point for the error takes place after running the following, with the resulting output: rawToChar(dta$content) I'm new to this, but it looks like the structure of dta$content has changed? |
Thanks for letting me know, this is one i forgot to test. The api seems okay, but something did change. The error is from the api_historicals_options <- function(RH, chain_symbol, type, strike_price, expiration_date,
interval = NULL, span = NULL) {
# Call to get the option instrument id
dta <- api_instruments_options(RH, method = "symbol",
chain_symbol = chain_symbol,
type = type,
strike_price = strike_price,
expiration_date = expiration_date)
... |
I suggest a few changes:
Hope this helps, below worked with the minimal testing I did against it. library(httr) RH <- RobinHood(your account stuff) #For testing the function #alternate set api_historicals_options_v2<-function (RH, chain_symbol, type=NULL, strike_price=NULL,expiration_date_param = expiration_date_param, dta <- api_instruments_options(RH, method = "symbol", chain_symbol = chain_symbol, if(!is.null(expiration_date_param)){ #If don't want to set strike price but only want near the money options dta<-dta%>% option_id <- dta$id token <- paste("Bearer", RH$api_response.access_token) loop_pull<-function(){
} full_data<-data.frame() get_historicals_options_v2<-function (RH, chain_symbol, type=NULL, strike_price=NULL, expiration_date_param = NULL, historicals <- api_historicals_options_v2(RH, chain_symbol = chain_symbol, historicals$strike_price <- strike_pricehistoricals$expiration_date <- expiration_datehistoricals$type <- typehistoricals$chain_symbol <- chain_symbolif(!is.null(expiration_date)){ historicals <- historicals %>% dplyr::select("chain_symbol", old_function<-get_historicals_options(RH,chain_symbol = "AAPL",type = "call",strike_price = 100,expiration_date = "2023-06-09",interval = "10minute",span = "day")#For single option selection #For wildcard option selection using near the money option. |
the markdown is making my comment look funny just copy and paste it into R studio and it looks fine. |
Getting the following error when I run the example code for get_historicals_options:
Error in parse_url(url) : length(url) == 1 is not TRUE
Perhaps related to the changes behind the HTTP 400 Bad Request issues?
Thank you for your time!
The text was updated successfully, but these errors were encountered: