INNER CODE UNIT · Python
_hist
ibaihuo/chanvis · api/chanapi.py:535
_hist = res[-400:]
data = []
for row, next_row in zip(_hist[:-1].to_dict(orient='records'),
_hist[1:].to_dict(orient='records')):
item = {'start_dt': row['datetime'],
'end_dt': next_row['datetime'],
'high': float(row['high']),
'low': float(row['low']),
}
# # 股票里面的一天的开始和结束等
# if symbol in ('SH',) and resolution in ('1', '5'):
# item['start_dt'] = item['start_dt'] + ' 09:31:00'
# item['end_dt'] = item['end_dt'] + ' 09:31:00'
# elif symbol in ('SH',) and resolution in ('15', '30'):
# item['start_dt'] = item['start_dt'] + ' 09:30:00'