exploringfinance / rameritrade Goto Github PK
View Code? Open in Web Editor NEWR package for the TD Ameritrade API
License: GNU General Public License v3.0
R package for the TD Ameritrade API
License: GNU General Public License v3.0
Hi, I've been using the rameritrade library and it's been excellent.
What I'd like to report here is not really an issue, it's more of a suggestion. The library supports many order types, but Limit on Close (LOC) orders are not accepted, even though TD Ameritrade do support LOC orders. The lirbrary accepts Market on Close, but not Limit on Close orders, so I suspect it might be easy to implement it.
Error: 400 - 'LIMIT_ON_CLOSE' is not a valid orderType. Valid values are (for Order and SavedOrder) 'MARKET', 'LIMIT', 'STOP', 'STOP_LIMIT', 'TRAILING_STOP', MARKET_ON_CLOSE', 'TRAILING_STOP_LIMIT', (these are only valid for Order) 'EXERCISE', 'NET_DEBIT', 'NET_CREDIT', 'NET_ZERO'.
Would it be possible to add this order type?
Thanks for the library, it's awesome!
Error in Price History function td_priceHistory
td_priceHistory(tickers = c("AAPL", "MSFT"), startDate = Sys.Date() - 30,
endDate = Sys.Date(), freq = c('30min'), accessToken = NULL)
Error: 400 - Bad request.
This is not an issue but a request for another function that can modify an existing order.
I am trying to request minute data. But I was not successful. How to request minute data?
R> tickHistDay = td_priceHistory(c('SPY','IWM'), startDate = '1990-01-01')
No encoding supplied: defaulting to UTF-8.
No encoding supplied: defaulting to UTF-8.
R> head(tickHistDay)
# A tibble: 6 x 8
ticker date date_time open high low close volume
<chr> <date> <dttm> <dbl> <dbl> <dbl> <dbl> <int>
1 SPY 1993-01-29 1993-01-29 01:00:00 44.0 44.0 43.8 43.9 1003200
2 SPY 1993-02-01 1993-02-01 01:00:00 44.0 44.2 44.0 44.2 480500
3 SPY 1993-02-02 1993-02-02 01:00:00 44.2 44.4 44.1 44.3 201300
4 SPY 1993-02-03 1993-02-03 01:00:00 44.4 44.8 44.4 44.8 529400
5 SPY 1993-02-04 1993-02-04 01:00:00 45.0 45.1 44.5 45 531500
6 SPY 1993-02-05 1993-02-05 01:00:00 45.0 45.1 44.7 45.0 492100
R> tickHistDay = td_priceHistory(c('SPY','IWM'), startDate = '1990-01-01', freq='1m')
Error: 400 - Bad request.
R> tickHistDay = td_priceHistory(c('SPY','IWM'), startDate = '2020-01-01', freq='1m')
Error: 400 - Bad request.
R> tickHistDay = td_priceHistory(c('SPY','IWM'), startDate = '2020-01-01', endDate='2020-01-10', freq='1m')
Error: 400 - Bad request.
R> tickHistDay = td_priceHistory(c('SPY','IWM'), startDate = '2020-07-11', freq='1m')
Error: 400 - Bad request.
the README says that it is not on CRAN etc.. installation instructions also should default to install the CRAN version
I am trying to use this (great) package to text myself updates on my portfolio at certain times of the day, but I am having issues with CronR. A function of mine calls rameritrade::td_auth_accessToken(consumerKey, refreshToken)
, which appears to be the cause of the issue. It should be noted that this message does not appear when running it manually, only when I attempt to schedule it. The error message in my log is:
"Error in ram_checkRefresh(refreshToken) :
Incorrect object type passed as Refresh Token. Please pass the output from auth_init_refreshToken or auth_new_refreshToken.FALSE
Calls: get_acct -> -> ram_checkRefresh
Execution halted"
Thanks for any and all assistance.
@exploringfinance, thanks for creating the package! Also understand that you won't make any changes till the Schwab integration and its impact on ToS API is clear.
But I thought I would flag this one as I tried, but I was unable to get passed authentication in step 8. I ran the following:
td_auth_refreshToken("CONSUMERAUTHORIZATIONCODE",
"https://callbackURL",
"https://testing/?code=CONSUMERAUTHORIZATIONCODE")
The error message I received was the following:
"Error: The auth code provided does not appear to be a valid auth code. Please confirm the URL link from a successful login was passed."
I double checked for typos and there shouldn't be any. Any idea(s)?
I see the close price of the current day is not correct. The correct value should be 59.07, but it is shown as 60.7.
I also see other tickers having this problem, but not all tickers have this problem. Does anybody know what is wrong?
R> tail(rameritrade::td_priceHistory('DWAC'), n=1)
No encoding supplied: defaulting to UTF-8.
# A tibble: 1 x 8
ticker date date_time open high low close volume
<chr> <date> <dttm> <dbl> <dbl> <dbl> <dbl> <int>
1 DWAC 2021-10-26 2021-10-26 00:00:00 87.1 91.4 55.5 60.7 26657852
https://rdrr.io/cran/rameritrade/man/td_optionChain.html
I only see how to download the current price of options. Is there a way to get the historical prices of options via rameritrade?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.