using variables in get_data
Hello developer community,
i have been looking for the answer to the question on this site and other places, but was not successful and need your help.
this is my question. I have an ISIN code and need TR.FundNAV.
ek_data, err = ek.get_data('LU1725405200' , ['TR.FundNAV.Date','TR.FundNAV'], \
{'Frq':'D', 'SDate': '2021-03-20', 'EDate': '2021-03-21'})
this works perfectly ok.
I need to change ISIN code, start date and end date in several ways, and wanted to use variables, like below.(givenisin, startdte, enddate are variables)
ek_data, err = ek.get_data(givenisin , ['TR.FundNAV.Date','TR.FundNAV'], \
{'Frq':'D', 'SDate': startdate, 'EDate': enddate})
but variables for startdate and enddate are not able to extract in get_data command. the variable givenisin works ok.
how can i express these startdate/enddate parameters in variables?
thanks,
--Shin
Find more posts tagged with
Hi @jirapongse.phuriphanvichai thanks for quick response.
you are rt. i tested the lines u gave me, and it worked on my console.
what I found was i got startdate and enddate value from sql result and it needs to be converted as "date" type. dont really know why startdate = ''2021-03-20' works and queried date does not work, but i know have script working.
Thanks!!!!
--Shin
The following code works in my environment.
givenisin = 'LU1725405200'
startdate = '2021-02-20'
enddate = '2021-03-21'
ek_data, err = ek.get_data(givenisin ,
['TR.FundNAV.Date','TR.FundNAV'],
{'Frq':'D', 'SDate': startdate, 'EDate': enddate})
ek_data
@shinji.kakizaki1
The following code works in my environment.