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
1 0 0 1

Dear Sirs, Is it possible to download mid of month historical data for constituents or index. If yes, how to do it? Please let me know.

Dear Sirs, Is it possible to download mid of month historical data for constituents or index? Using ek.get_data()? If yes, how to do it? Please let me know.

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-api
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.

@Stanislav.Zakovic

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS

Upvotes
Accepted
39.4k 77 11 27

@Stanislav.Zakovic

I assume you made a typo in the example get_data call you provided. The value of Frq parameter you meant to have there is 'M', right? If you retrieve timeseries with 'Frq':'M', monthly values will indeed be the close prices for the last day of each month. If you'd like to construct monthly timeseries of close prices for say the 15th of each month, you have two options. One is to retrieve the close prices separately for each date in your timeseries, i.e. in a loop separately call

ek.get_data(constituent, ['TR.PriceClose.Date','TR.PriceClose'], {'SDate' : '2010-01-15'})

ek.get_data(constituent, ['TR.PriceClose.Date','TR.PriceClose'], {'SDate' : '2010-02-15'})

etc., and concatenate the results.

Or you can retrieve daily price history using 'Frq':'D' parameter, as in the get_data example in your previous response, and then use pandas indexing and selecting capabilities to extract from the result the values you're interested in using whatever logic you want to use.

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
39.4k 77 11 27

You can retrieve the constituents of an index as of any historical date using

ek.get_data('0#.SPX(2021-02-16)','TR.CommonName')

And then, if you're interested, you can retrieve historical prices for the constituents as of a given date. Or you can retrieve both in a single call, e.g.

ek.get_data('0#.SPX(2021-02-16)','TR.ClosePrice(SDate=2021-02-16)')

Is this what you were looking for?

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
1 0 0 1

Thank you Alex. It does not answer my question in full. Assume I have start dat = 2010-01-15, end dat = 2021-01-15. I want to download monthly data from start date to end date. I am using something like this:


ek.get_data( constituent, ['TR.PriceClose.Date','TR.PriceClose'], {'SDate' : start_date, 'EDate' : end_date, 'Frq': 'D'})


However, I usually get right values but say end of month values. How do I get a time series of mid-month values?

Thanks in advance,


Stanislav

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
1 0 0 1

Hi Alex,


Thanks a lot for your answer. Yes, it was a small eror, I should have put M, instead of D. So, this holds for any daily data that I might be interested in. For example:

'TR.TotalReturn(SDate=2020-01-15,EDate=2010-01-15,Frq=M)'


would also yield end of month results?


If I go along with your suggestion, and download for each date separately, what would happen if, say, 15th of Feb 2007 was Sunday? Would it give me empty field, or automatically move to Monday (the next available day), or, maybe Friday (previously available day), the 13th?


Thanks in advance,


Stanislav


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
39.4k 77 11 27

Yes, daily timeseries summarized into monthly intervals are always anchored to the end of the month.
When requesting daily timeseries, if you only specify SDate and the value of SDate corresponds to a non trading day, the values from the previous trading day are returned.

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
1 0 0 1

Great, thanks a lot Alex.


Regards,


Stanislav

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
1 0 0 1

Hi Alex,


Before I accept your answer, just a quick note that I am a bit surprised that we can not download monthly data on any given date. I seem to remember that before, when I was using excel, it was possible to set the date and download monthly data mid month. Or maybe I mixed up something?

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
39.4k 77 11 27

@Stanislav.Zakovic

You must be mixing up things. I'm not aware of any Refinitiv products that have the capability to return monthly timeseries representing a given date of the month (e.g. anchored to the 15th of each month). Certainly Eikon never had that capability.

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.

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.