Codebook Python vs standard Python - different outputs (get_historical_price_summaries)
Hello,
yesterday shortly after 6 PM (CET) I've tried to fetch EURAB6E10Y= last availible values, on one hour interval (code below). Running it on codebook python kernell returned exact values from 6PM, while running it on Python installed in my computer it showed that last availible value is from 5PM.
How is it even possible that the same function, in almost the same time, returns different values?
The same happend few days ago (4.12), when I tried to fetch WIPLNOND= values for 3.12 6PM. In codebook i got 3.12 6PM value as output, but in my python 2.12 6PM. After that I dropped "end=cut_datetime" and "count=2" parameters to see what would happened, and finally value from 3.12 6PM appeared on my screen.
Could You help me to understand why this function is working differently in this two enviorments?
Maybe there is a better way to fetch ecah day last availible at 6PM data for this instruments?
cut_datetime = datetime.datetime(2021,12,6,16,0,1) # 16 is 6PM in my timezone
rdp.get_historical_price_summaries("EURAB6E10Y=", rdp.Intervals.ONE_HOUR, end=cut_datetime, count=2, fields=["MID_PRICE"]).iloc[-1]
Best Answer
-
Hi @rafal.belka
The historical pricing service expects time specification to be in utc. Try this instead for both environments:
cut_datetime = datetime.datetime(2021,12,6,16,0,1,tzinfo=datetime.timezone.utc)
And 16 is 4 P.M. If you want 6.PM. UTC, ensure it is 18.
1
Answers
-
Thanks @nick.zincone!
Today I will try adding tzinfo to my datetime object. I hope it's solution for my problem.
0 -
@nick.zincone It worked, thank You!
0
Categories
- All Categories
- 6 AHS
- 39 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 中文论坛