Expired contracts data using eikon api
Hi,
I am trying to get the data for 2019 August contract of Brent Crude oil. The code I have written is:
df, ek = e.get_data('LCOQ9^1',
['TR.SETTLEMENTPRICE .date','TR.SETTLEMENTPRICE '], {'SDate':'-3M', 'EDate':'0D' })
The output:
NaN TR.SETTLEMENTPRICE .DATE TR.SETTLEMENTPRICE
0 LCOQ9^1 NaN NaN
I have also used CLOSEPRICE in place of SETTLEMENTPRICE, but still getting NaN.
There is no error message.
I have referred to this post on the forum:
Tagged:
0
Best Answer
-
Hello @varun.divakar
I tried expanding the time range, and was able to get some data. Seems like you have to include the time range when this contract was active. See if this works for you.
>>> ek.get_data('LCOQ9^1', ['TR.SETTLEMENTPRICE.date','TR.SETTLEMENTPRICE'], {'SDate':'-12M', 'EDate':'0D' })
( Instrument Date Settlement Price
0 LCOQ9^1 2019-04-30T00:00:00Z 71.45
1 LCOQ9^1 2019-05-01T00:00:00Z 71.50
2 LCOQ9^1 2019-05-02T00:00:00Z 70.02
3 LCOQ9^1 2019-05-03T00:00:00Z 70.03
4 LCOQ9^1 2019-05-06T00:00:00Z 70.37
5 LCOQ9^1 2019-05-07T00:00:00Z 69.07
6 LCOQ9^1 2019-05-08T00:00:00Z 69.62
7 LCOQ9^1 2019-05-09T00:00:00Z 69.48
8 LCOQ9^1 2019-05-10T00:00:00Z 69.64
9 LCOQ9^1 2019-05-13T00:00:00Z 69.31
10 LCOQ9^1 2019-05-14T00:00:00Z 70.31
11 LCOQ9^1 2019-05-15T00:00:00Z 70.90
12 LCOQ9^1 2019-05-16T00:00:00Z 71.70
13 LCOQ9^1 2019-05-17T00:00:00Z 71.26
14 LCOQ9^1 2019-05-20T00:00:00Z 71.16
15 LCOQ9^1 2019-05-21T00:00:00Z 71.31
16 LCOQ9^1 2019-05-22T00:00:00Z 69.99
17 LCOQ9^1 2019-05-23T00:00:00Z 66.50
18 LCOQ9^1 2019-05-24T00:00:00Z 67.47
19 LCOQ9^1 2019-05-27T00:00:00Z 68.77
20 LCOQ9^1 2019-05-28T00:00:00Z 68.67
21 LCOQ9^1 2019-05-29T00:00:00Z 67.87
22 LCOQ9^1 2019-05-30T00:00:00Z 65.33
23 LCOQ9^1 2019-05-31T00:00:00Z 61.99
24 LCOQ9^1 2019-06-03T00:00:00Z 61.28
25 LCOQ9^1 2019-06-04T00:00:00Z 61.97
26 LCOQ9^1 2019-06-05T00:00:00Z 60.63
27 LCOQ9^1 2019-06-06T00:00:00Z 61.67
28 LCOQ9^1 2019-06-07T00:00:00Z 63.29
29 LCOQ9^1 2019-06-10T00:00:00Z 62.29
.. ... ... ...
251 LCOQ9^1 2020-04-15T00:00:00Z NaN
252 LCOQ9^1 2020-04-16T00:00:00Z NaN
253 LCOQ9^1 2020-04-17T00:00:00Z NaN
254 LCOQ9^1 2020-04-20T00:00:00Z NaN
255 LCOQ9^1 2020-04-21T00:00:00Z NaN
256 LCOQ9^1 2020-04-22T00:00:00Z NaN
257 LCOQ9^1 2020-04-23T00:00:00Z NaN
258 LCOQ9^1 2020-04-24T00:00:00Z NaN
259 LCOQ9^1 2020-04-27T00:00:00Z NaN
260 LCOQ9^1 2020-04-28T00:00:00Z NaN
261 LCOQ9^1 2020-04-29T00:00:00Z NaN
262 LCOQ9^1 2020-04-30T00:00:00Z NaN
263 LCOQ9^1 2020-05-01T00:00:00Z NaN
264 LCOQ9^1 2020-05-04T00:00:00Z NaN
265 LCOQ9^1 2020-05-05T00:00:00Z NaN
266 LCOQ9^1 2020-05-06T00:00:00Z NaN
267 LCOQ9^1 2020-05-07T00:00:00Z NaN
268 LCOQ9^1 2020-05-08T00:00:00Z NaN
269 LCOQ9^1 2020-05-11T00:00:00Z NaN
270 LCOQ9^1 2020-05-12T00:00:00Z NaN
271 LCOQ9^1 2020-05-13T00:00:00Z NaN
272 LCOQ9^1 2020-05-14T00:00:00Z NaN
273 LCOQ9^1 2020-05-15T00:00:00Z NaN
274 LCOQ9^1 2020-05-18T00:00:00Z NaN
275 LCOQ9^1 2020-05-19T00:00:00Z NaN
276 LCOQ9^1 2020-05-20T00:00:00Z NaN
277 LCOQ9^1 2020-05-21T00:00:00Z NaN
278 LCOQ9^1 2020-05-22T00:00:00Z NaN
279 LCOQ9^1 2020-05-25T00:00:00Z NaN
280 LCOQ9^1 2020-05-26T00:00:00Z NaN0
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 中文论坛