Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon COM /
avatar image
REFINITIV
Question by adam.pawlowicz.TR · Feb 13, 2017 at 10:31 AM · eikoneikon-com-apicallback

How can I run Rhistory in a loop?

What I would like to do is to run RHistoryQuery get the results from callback event OnImage and pass it to AdInterp function. Is it possible to loop the following steps for different Instrument lists (for the Rhistory) and retrieve only the results from the Adinterp?

Best Regards,

Adam

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

4 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Alex Putkov.1 · Feb 13, 2017 at 04:50 PM

Yes, it's possible and there's more than one way of doing it.

First of all you can retrieve multiple instruments in a single request, just like you can with RHistory worksheet function.

Then, if for whatever reason you need to retrieve your instruments one by one, you can do this by introducing a module level counter. You will need to initialize it and call the data requesting procedure for the first instrument in the list. In the OnImage event handler you can apply AdInterp function and output the result. Then you can increment the counter, check if the counter is still in range for your list of instruments, and if yes call the requesting procedure for the next instrument from the list. This process will break if there are any invalid instruments in the list. To handle it you'll also need to implement the same logic in the OnError event handler.

Finally, you can create an instance of RHistoryQuery object per instrument, and place all these objects into a collection, so they remain in memory while the data is being retrieved. In this case to manage the event handling you will need to create a custom class.

These are your options.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by adam.pawlowicz.TR · Feb 14, 2017 at 06:57 AM

Thank you Alex! I need to interpolate a spread for a list of instruments, hence asking for the Rhistory loop. By the way, do you happen to have an example of the module level counter...it would definitely save me some time.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by Alex Putkov.1 · Feb 14, 2017 at 03:21 PM

I cannot say I understand why you prefer retrieving timeseries one instrument at a time over retrieving them all at once, which will be faster. Once you've retrieved the timeseries you can apply whatever analytics you want to the data you retrieved. Whatever you rationale, attached is an example of doing both: retrieving the list of instruments in one request and retrieving the list in a loop one instrument at a time. I hope you find it useful.

rhistoryverybasicsample.zip


rhistoryverybasicsample.zip (37.1 KiB)
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by adam.pawlowicz.TR · Feb 15, 2017 at 10:45 AM

Thank you so much Alex! This is exactly what I needed. I have number of chain RICs from which I intended to get the Spread curves, which were used in the Adinterp function.

Thanks again!

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
7 People are following this question.

Related Questions

callback in VBA relies on application.enableevents being set to true

How can I use the .NET API in batch(non-callback) query mode?

Excel API: formula builder - retreive data from local server

RDATA batch request with individual Sdate parameters

Eikon: Missing millisecond in Real Time Tick Data with view TRDPRC_1

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges