yogat3ch / AlpacaforR

Connecting to Alpaca API and using it with R
35 stars 20 forks source link

get_orders returns always 50 rows #15

Closed nba2020 closed 4 years ago

nba2020 commented 4 years ago

I'm querying the list of open orders in my paper account with the below code:

OpenOrders<-get_orders(status = "open",live=FALSE)

The code runs but it returns always 50 rows of orders, although I actually have 100+open orders

jagg19 commented 4 years ago

Hi @nba2020,

Sorry for the late response on these. Im not sure if you fixed it, but get_orders has a "limit" parameter to limit the # of rows to return get_orders(limit=500). The default is set to 50 and can be set to a max of 500. I've included that in the docs as well.

Thanks!

nba2020 commented 4 years ago

Thanks, @jagg19 I've tested the following with a new paper account that has no orders yet.

OpenOrders<-get_orders(status = "open",live=FALSE,limit=500)

but I hit the following error

Error in get_orders(status = "open", live = FALSE, limit = 500) : 
  unused argument (limit = 500)

Do I need to somehow update the package from the GitHub version? If I need to simply wait for this fix to be released with a new version, then my apologies as I'm new to GitHub :)

yogat3ch commented 4 years ago

Do I need to somehow update the package from the GitHub version?

Hey @nba2020 , Yes, devtools::install_github("jagg19/AlpacaforR")

nba2020 commented 4 years ago

Great, thank you @yogat3ch. I tested and it worked as expected!