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 Data APIs /
avatar image
Question by lgreen · Dec 02, 2020 at 11:01 PM · eikon python apipermidpython eikondate#get_data

ek.get_data - TR.PriceClose.date not working

i have the python code:

fields=[ek.TR_Field('TR.PriceClose',
                            {'Frq':'D',
                             'SDate':0,
                             'EDate':-365
                             },'asc',1),

                ek.TR_Field('TR.PriceClose.date',
                            {'Period':'D',
                             'SDate':0,
                             'EDate':-365
                             },'asc',1)

And I run this to get the data for the permid:

df,err=ek.get_data([4295905573],fields)    

This returns 1 line with <NA> for both fields.

df
Out[108]: 
            0  TR.PRICECLOSE(EDate=-9999,Frq=D,SDate=0)  \
0  4295905573                                      <NA>   

   TR.PRICECLOSE.DATE(EDate=-9999,Period=D,SDate=0)  
0                                              <NA>  

If I use JUST the field PriceClose, I get all the data, but there are no dates so kind of useless...

df
Out[112]: 
     Instrument  Price Close
0    4295281938        15.65
1    4295281938        15.65
2    4295281938        15.65
3    4295281938        15.65
4    4295281938        15.65
..          ...          ...
361  4295281938        15.65
362  4295281938        15.65
363  4295281938        15.65
364  4295281938        15.65
365  4295281938        15.65

[366 rows x 2 columns]


Need to return both price and date.

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.

2 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by chavalit.jintamalit · Dec 03, 2020 at 01:26 AM

Hi @lgreen

Please try this code:


ahs.png (27.7 KiB)
Comment
lgreen

People who like this

1 Show 1 · 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
lgreen · Dec 03, 2020 at 02:43 PM 0
Share

both of these answers work. thanks

avatar image
Answer by b.lee · Dec 03, 2020 at 01:41 AM

I guess we need to group the pair of fields (date and price) using the same period specification. Can you try:

fields = ek.get_data('4295905573',['TR.PriceClose.Date', 'TR.PriceClose'], {'SDate':0, 'EDate':-365})


Comment
lgreen

People who like this

1 Show 1 · 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
lgreen · Dec 03, 2020 at 02:42 PM 0
Share

both of these work. thanks.

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 >
11 People are following this question.

Related Questions

python eikon API - is there a parameter value for Edate which will get "all" the available history?

How can I use date function in python ?

Eikon python API not responding

Eikon python API for news headlines data

EMA with variable period

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • 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
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges