For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 0 1

get_date_from_today not defined

I'm using get_timeseries to pull close prices for two RICs. I want to use a relative date (2 years ago) for example for the start date using get_date_from_today. It's saying it's not defined. What should I be defining this as?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
get-date.png (48.7 KiB)
icon clock
10 |1500

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

Upvotes
Accepted
39.2k 75 11 27

Add the following line to your imports before calling get_date_from_today function

from eikon.tools import get_date_from_today

Alternatively call the function without additional imports, but with fully qualified modules

ek.tools.get_date_from_today(100)
icon clock
10 |1500

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

Upvotes
3 0 0 1

Awesome - thanks Alex.

icon clock
10 |1500

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

Upvotes
629 2 4 7

I think you just need to put quotes around "get_data_from_today(150)" ...

icon clock
10 |1500

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

Thanks James - Alex hit the nail on the head above... I needed to specify and/or import "eikon.tools" to use that type of functionality

Click below to post an Idea Post Idea