DSWS R API - run into some problems using R code to get data for 300 companies listed under ASX300

patelj
Newcomer
in Datastream
Hi There,
We put together a rough sketch of the code that could be used to access prices and market capitalisation of the 300 companies each day. I run into some problems using this code for all 300 companies, but could you please see if it works in this environment?
# Retrieve tickers ------------------------------------------------------
function_ds <- function(x) {use_dsws$listRequest(instrument = x,
datatype = c("NAME",
"MNEM"),
requestDate = "0D") %>%
mutate(mmyy = x)
}
tickers_300 <- function_ds("LASX300I")
# Retrieve price data for tickers -----------------------------------------
ts_req <- function(x) {use_dsws$timeSeriesListRequest(instrument = x,
datatype = c("P", "MV"),
startDate = "-0D",
endDate = "-0D",
frequency = "D")}
# the following line works properly - get price data for first 20 tickers but I cannot get price data for 30 tickers
# following results in error: Error requesting data. HTTP message was: Server error : Internal Server Error : Server error: (500) Internal Server Error
Can you recommend us on how to do this for larger quantity?
Tagged:
0
Best Answer
-
I got the same error.
To solve the problem, you need to reduce the chunkLimit. For example:
use_dsws$chunkLimit <- 20L
Then, use one datatype in the request.
ts_req <- function(x) {use_dsws$timeSeriesListRequest(instrument = x,
datatype = "P",
startDate = "-0D",
endDate = "-0D",
frequency = "D")}If you use more than one datatype, you will get this error "subscription out of bound". This issue has been fixed in 1.7.10 available on GitHub, as mentioned on this thread.
install_github("CharlesCara/DatastreamDSWS2R")
require(devtools)In conclusion, you need to upgrade the package to 1.7.10, and set the chunkLimit.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 249 ETA
- 554 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 643 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 192 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛