Yangami
#用中正全指\'000985.XSHG\'获取全部A股数据
pool=get_index_stocks(\'000985.XSHG\') #date存储05年开始全部交易时间 date=get_price(\'000002.XSHE\',start_date=\'2005-01-01\',end_date=\'2019-03-29\',fields=[\'close\',\'open\']) date=list([str(i)[:10] for i in list(date.index)]) #fields内选择需要的量价指标(基于聚宽get_price) pl=get_price(pool[:100],start_date=\'2005-01-01\',end_date=\'2019-03-29\',fields=[\'close\',\'open\']) for st in pool[:2]: print(st) close,_=pl.minor_xs(st)[\'close\'],pl.minor_xs(st)[\'open\'] with open(\'./rdata/\'+str(st)[:6]+\'.txt\',\'a\') as f: f.write(\'date\'+\'\t\'+\'close\'+\'\t\'+\'\n\') for dt in date: line=dt+\'\t\'+str(close[dt])+\'\t\'+\'\n\' f.write(line)

 

posted on 2019-03-30 16:00  Yangami  阅读(473)  评论(0编辑  收藏  举报

分类:

技术点:

相关文章:

  • 2022-01-14
  • 2021-10-28
  • 2021-08-20
  • 2021-05-31
  • 2021-09-22
  • 2022-12-23
  • 2022-01-21
  • 2021-12-20
猜你喜欢
  • 2021-04-04
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
相关资源
相似解决方案