I was using python api to download daily data, it seemed that the whole process was not stable. was it because I used for cycles?
import lseg.data as ld# Install with `pip install lseg.data`
ld.open_session()
DateTable2['startDs']=DateTable2.startD.dt.strftime('%Y-%m-%d')
DateTable2['endDs']=DateTable2.endD.dt.strftime('%Y-%m-%d')
manualTable=pd.concat([manualTable,DateTable2],axis=0)
for jj in range(DateTable2.shape[0]):
nameTag=DateTable2.Expired_Call_RIC[jj]
print(nameTag)
ss=DateTable2.startDs[jj]
ee=DateTable2.endDs[jj]
tempData=ld.get_history(
universe=nameTag,
# fields=["TR.CLOSEPRICE"],
fields=["TR.OPENPRICE", "TR.HIGHPRICE", "TR.LOWPRICE", "TR.CLOSEPRICE"],
interval="1D",
start=ss,
end=ee
)
HistoryRecordOption=pd.concat([HistoryRecordOption,tempData],axis=0)
theTargetCode=['TYU2^2', 'TYZ2^2', 'TYH3^2', 'TYM3^2', 'TYU3^2', 'TYZ3^2', 'TYH24^2', 'TYM24^2', 'TYU24^2', 'TYZ24^2', 'TYH25^2', 'TYM25^2', 'TYU25^2']
---------------------------------------------------------------------------LDError Traceback (most recent call last)Cell In[13], line 27 25 ss=DateTable2.startDs[jj] 26 ee=DateTable2.endDs[jj]---> 27 tempData=ld.get_history( 28 universe=nameTag, 29 # fields=["TR.CLOSEPRICE"], 30 fields=["TR.OPENPRICE", "TR.HIGHPRICE", "TR.LOWPRICE", "TR.CLOSEPRICE"], 31 interval="1D", 32 start=ss, 33 end=ee 34 ) 35 HistoryRecordOption=pd.concat([HistoryRecordOption,tempData],axis=0) 36 # time.sleep(61)File c:\Users\Bob\AppData\Local\Programs\Python\Python313\Lib\site-packages\lseg\data\_access_layer\get_history_func.py:212, in get_history(universe, fields, interval, start, end, adjustments, count, parameters, header_type) 210 if exceptions and all(exceptions): 211 except_msg = "\n\n".join(exceptions)--> 212 raise LDError(message=except_msg) 214 if not any({adc_data, hp_data, cust_inst_data}): 215 return DataFrame()LDError: Unable to collect data for the field 'TR.OPENPRICE' and some specific identifier(s). Requested universes: ['TY1225J2^J22']. Requested fields: ['TR.OPENPRICE', 'TR.HIGHPRICE', 'TR.LOWPRICE', 'TR.CLOSEPRICE']
If I manually use the questioned
'TY1225J2^J22', I can download the data. But if it was in the for cycle, also the code fails.