def getSingleStockByTime(symbol, from_date, till_date):
start = from_date.split('-')
start_y, start_m, start_d = start[0], start[1], start[2] # starting date
end = till_date.split('-')
end_y, end_m, end_d = end[0], end[1], end[2] # until now
repeat_times = 1
message = ""
df = pd.DataFrame()
for _ in range(repeat_times):
try:
data = ts.get_k_data(symbol)#, from_date, till_date)
data.sort_index(ascending=True, inplace=True)
return data, ""
except Exception as e:
message = symbol + " fetch exception: " + str(e)
continue
return df, message
Fetch_Data_Stock_CHN_Daily.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录