i have noticed that running those 2 requests to get prices for a stock over different range return different data:
Version1:
data,err = ek.get_data(['000001.SZ'], ['TR.PriceCloseDate(SDate="2018-10-02", EDate="2018-12-31"),TR.ClosePrice(SDate="2018-10-02", EDate="2018-12-31")'])
This returns:
2018-10-08 - NaN
2018-10-09 - NaN
2018-10-10 - NaN
2018-10-11 - NaN
2018-10-12 - 10.45
Version2:
data,err = ek.get_data(['000001.SZ'], ['TR.PriceCloseDate(SDate="2018-06-02", EDate="2018-12-31"),TR.ClosePrice(SDate="2018-06-02", EDate="2018-12-31")'])
This returns:
2018-10-08 - 10.45
2018-10-09 - 10.56
2018-10-10 - 10.45
2018-10-11 - 9.86
2018-10-12 - 10.3
Can anyone explain what is going on? Why do I get different prices for the same date? and all those NaN? Is there something wrong in request?
Hi @Tulkkas
You are using fields that are not aligned in a one time series.
TR.PriceCloseDate, TR.PriceClose, TR.PriceClose.date
and
TR.ClosePrice, TR.ClosePrice.date
Please have a look at the example below
ek.get_data('000001.SZ', ['TR.PriceCloseDate,TR.PriceClose,TR.PriceClose.date,TR.ClosePrice,TR.ClosePrice.date'],{"SDate": "2018-10-01", "EDate":"2018-12-31"})
I hope it clarifies
Thx for the explanation. I indeed did not notice those series were not aligned. So what is the difference between PriceClose and ClosePrice and what is recommended to use?
Eikon Scripting API: issues with timeseries
Eikon Desktop Data API stopped working after changing to a new user on Eikon terminal
Need VWAP historically in Eikon API. Cannot translate Excel Rhistory to Python get_timeseries().
get more data field on tick data of ek.get_timeseries()?
get_timeseries returns date that does not exist in Eikon and with NA for close price