Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 1 2 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-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-api
get-date.png (48.7 KiB)
icon clock
10 |1500

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

Upvotes
Accepted
39.4k 77 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 512.0 KiB each and 1.0 MiB total.

Upvotes
3 1 2 1

Awesome - thanks Alex.

icon clock
10 |1500

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

Upvotes
644 4 7 8

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 512.0 KiB each and 1.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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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