Why does
import lseg.data as ld
ld.open_session()
start = '2024-09-23'
end = '2025-03-24'
ld.get_data(
universe=['8729.T'],
fields=['TR.ClosePrice', 'HST_CLOSE', 'CF_CLOSE', 'TR.PRICECLOSE', 'TRDPRC_1'],
parameters = {'SDate': start, 'EDate': end})
and
import lseg.data as ld
ld.open_session()
start = '2024-09-23'
end = '2025-03-24'
ld.get_data(
universe=['8729.T'],
fields=['TR.ClosePrice', 'HST_CLOSE', 'CF_CLOSE', 'TR.PRICECLOSE', 'TRDPRC_1'],
parameters = {'SDate': start, 'EDate': end})
fail, and yet
import datetime
import lseg.data as ld
ld.open_session()
start = '2024-09-23'
end = '2025-03-24'
d1 = datetime.datetime.strptime(start, '%Y-%m-%d')
d2 = datetime.datetime.strptime(end, '%Y-%m-%d')
diff = (d2 - d1).days
ld.get_data(
universe = ['8729.T'],
fields = [f'TR.PriceClose(SDate=0,EDate=-{diff}).date', f'TR.PriceClose(SDate=0,EDate=-{diff})'])
work?
This is very problematic, and it does not have to do with the LSEG Data Library for Python (I know it looks like it does); it's to do with the underlying data and/or data model. Maybe there is a missing mapping in the backend (in RDP to the Historical Pricing API Endpoint)?