Real time last price including extended hours trading
Hi,
I am trying to get the last price for a specific instrument, but I want the price to include prices from extended hours. I have tried two fields: CF_LAST and IRGPRC. The first does not include trades from extended hours, whereas IRGPRC is reset every day, so if no trades have occured today, zero is returned. From excel I have been advised to use the Rhistory function as follows:
=RHistory("AAPL.O","TRDPRC_1.Timestamp;TRDPRC_1.Value;TRDPRC_1.Count","NBROWS:1 ADJUSTED:NO INTERVAL:TAS",,,I7),
since no live data field can give me what I am after, but I have not been able to translate this into a AdxRtHistory query. I have been able to create a historic query using the historic .net api, but I have only been able to do it by requesting data from a specific timestamp and potentially this can be a lot of data. Do you have any suggestions?
Thanks,
Andreas
Best Answer
-
My bad. I omitted the filter to include extended hours trade records:
.WithFilter(filter => filter.IncludeOutOfSessionRecords(true))
This should do it.
0
Answers
-
@jeppe which RIC are you trying to query? Extended traded sessions may affect the live RIC differently on different exchanges.
AdxRtHistory only supports inter-day data, so requesting intraday time series will not work, so the only only API that might be of use for you is .NET.
0 -
Hi Andreas,
You're on the right track with this: "I have been able to create a historic query using the historic .net api, but I have only been able to do it by requesting data from a specific timestamp and potentially this can be a lot of data." When setting up timeseries request use the following methods of ITimeSeriesDataRequestSetup interface:
.WithInterval(CommonInterval.Trades)
.To(DateTime.Now)
.WithNumberOfPoints(1)This will allow you to retrieve the single latest trade.
0 -
That does the trick of getting the latest trades. Thank you. Unfortunately, I get some strange behavior. My request looks like this:
request = timeSeries.SetupDataRequest("MSFT.O")
.WithAllFields()
.To(DateTime.Now)
.WithInterval(CommonInterval.Trades)
.WithNumberOfPoints(59)
.OnDataReceived(DataReceivedCallback)
.CreateAndSend();With this request I get back 59 data points, but they do not include trades from extended trading hours. If I specify 58 number of points, zero data points are returned. If I instead use .To(DateTime.Today), the requested number of points is returned (still missing extended hours), but by adding seconds (.To(DateTime.Today.AddSeconds(12))) I sometimes get zero sometimes the requested number of data points depending on the requested number and the added seconds.
0 -
It works! Thanks a million!
Do you by any chance have an example console application too? I am having trouble translating the message pump stuff.
0 -
Hi Andreas,
All the examples in the downloads section on this API are console applications:
https://developers.thomsonreuters.com/eikon-apis/net-apis-use-custom-applications/downloads
Have you seen these? Anything in particular you're struggling with? There are numerous ways to start Windows message pump. The technique used in the above examples is one way, there are several others, e.g. using Application.Run method.
0 -
I figured out my issues, and those are the examples I have been working on.
Thank you very much for your help.
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 中文论坛