How do I get data for holidays and weekends in Excel VBA via RHistoryAPI
Hi,
I use the Basic AdxHistory.xlsm Makro in order to download daily closing price for some instrument. I get only the dates, when the price was published. However, I need the complete time series, where holidays and weekends are also present. What do I do? I would expect the .Mode property, but it does not help. Small example how I want to see it:
Friday - 100
Saturday - NA
Sunday - NA
Monday - 110
Instead I see:
Friday - 100
Monday - 110
Here is the macro.
Option Explicit
Dim WithEvents myAdxRtHist As AdfinXRtLib.AdxRtHistory
'*********INTERDAY*********************
Private Sub cmdGetInterday_Click()
Dim arrFlds() As Variant
ActiveCell.Select
' Note the use of CreateReutersObject - function in the PLVbaApis module.
If myAdxRtHist Is Nothing Then Set myAdxRtHist = CreateReutersObject("AdfinXRtLib.AdxRtHistory")
On Error GoTo errHndlr
With myAdxRtHist
.FlushData
.ErrorMode = EXCEPTION ' EXCEPTION, DialogBox, NO_EXCEPTION
.Source = "IDN"
.ItemName = [C7].Value
.Mode = [H8].Value
.RequestHistory ("DATE,CLOSE") 'NOTE USE OF OLD FIELD NAMES, NOT ("TRDPRC_1.TIMESTAMP,TRDPRC_1.CLOSE,TRDPRC_1.VOLUME")
'arrFlds = Array("DATE","CLOSE","VOLUME")
'.RequestHistory ()arrFlds
'.RequestHistory ("*") ' "*" requests all fields.
End With
Exit Sub
errHndlr:
[F13].Value = Err.Number & " " & Err.Description
End Sub
Best Answer
-
@aleksei.shvetsov
Your code is referencing the AdfinX history module. I think you need to use the RHistory API, which has the same parameters and arguments as the RHistory function; you can then specify NULL:NA and DAY:A to get a table like this (which is, I think, what you want to achieve):
1
Answers
-
Hi @aleksei.shvetsov,
For RHistory function you can add 'DAY:A' as display parameters in formula to shows all days including the weekend. I don't know if it works for AdxRtHistory but you can try in .Mode.
What you can add to .Mode (and maybe it will work):
NULL:NA ->The Null attribute dictates how empty entries should be handled. The NULL keyword defines the action taken only where date entries with null data are encountered. Dates before the start date or following the end date of the time series are always ignored.
1 -
Hi, here is my RequestMode:
START:060120 END:061720 SORT:ASC FRQ:D NULL:NAThe DAY:A returns me an error "invalid keyword"
You can pick up any underlying, for Example .SPX
So I basically do not get empty cells at all. Is there any solution to this? I do not want to guess, whether it was a holiday, but retrieve the data directly from Reuters.
Thank you!
0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛