def get_stick_hisdata_d(self,begin_date,end_date):
# cur.execute("select code,outstanding from t_all_stickcode where outstanding < 50000 and (substr(code,1,1)='0' or substr(code,1,1)='6'); ;")
self.cur.execute("select code,outstanding from t_all_stickcode ;")
sqlrs = self.cur.fetchall();
# self.cur.execute("delete from t_stick_data_d")
self.sqlconn.commit()
for code in sqlrs:
print(code[0]+'_d' )
try:
rs = ts.get_k_data(code=code[0],start=begin_date,end=end_date,ktype='D')
except Exception as e:
print('ERR:',e)
continue
# rs.to_sql('t_stick_data_d',self.engine,if_exists='replace',index=False);
self.db.delete_date('t_stick_data_d',end_date,code[0])
self.db.insert_data('t_stick_data_d',rs.as_matrix())
self.sqlconn.commit()
return
评论列表
文章目录