当前位置:网站首页>掘金量化:通过history方法获取数据,和新浪财经,雪球同用等比复权因子。不同于同花顺
掘金量化:通过history方法获取数据,和新浪财经,雪球同用等比复权因子。不同于同花顺
2022-07-06 19:26:00 【人工智能曾小健】
# coding=utf-8
from __future__ import print_function, absolute_import
from gm.api import *
# 可以直接提取数据,掘金终端需要打开,接口取数是通过网络请求的方式,效率一般,行情数据可通过subscribe订阅方式
# 设置token, 查看已有token ID,在用户-密钥管理里获取
set_token('xxxxxxxxxxxxxxxd')
# 查询历史行情, 采用定点复权的方式, adjust指定前复权,adjust_end_time指定复权时间点
data = history(symbol='SHSE.600000', frequency='1d', start_time='2020-01-01', end_time='2022-07-04', # 09:00:00 16:00:00
fields='bob,open,high,low,close', adjust=ADJUST_POST, adjust_end_time='2022-07-05',df=True) #adjust_end_time='2020-12-31',
data['bob'] = data['bob'].astype(str)
data['bob'] = data['bob'].str[0:10]
data
边栏推荐
猜你喜欢
Redis入门完整教程:问题定位与优化
MMDetection3D加载毫米波雷达数据
Electrical engineering and automation
Redis入门完整教程:复制拓扑
MySQL - common functions - string functions
巴比特 | 元宇宙每日必读:IP授权是NFT的破圈之路吗?它的难点在哪里?Holder该如何选择合作平台?...
[secretly kill little partner pytorch20 days] - [Day1] - [example of structured data modeling process]
PSINS中19维组合导航模块sinsgps详解(时间同步部分)
Redis入門完整教程:問題定比特與優化
左程云 递归+动态规划
随机推荐
Redis introduction complete tutorial: replication principle
Cglib agent in agent mode
[2022 national tournament simulation] polygon - computational geometry, binary answer, multiplication
Here comes a white paper to uncover the technology behind Clickhouse, a node with 10000 bytes!
Redis入门完整教程:客户端常见异常
惯导标定国内外研究现状小结(删减版)
The 8 element positioning methods of selenium that you have to know are simple and practical
Babbitt | metauniverse daily must read: is IP authorization the way to break the circle of NFT? What are the difficulties? How should holder choose the cooperation platform
MySQL提升大量数据查询效率的优化神器
数字滚动增加效果
uniapp的表单验证
安全交付工程师
Redis入门完整教程:复制拓扑
Change your posture to do operation and maintenance! GOPs 2022 Shenzhen station highlights first!
一文读懂Faster RCNN
AWS learning notes (I)
Matlb| economic scheduling with energy storage, opportunity constraints and robust optimization
uniapp适配问题
Redis入门完整教程:客户端管理
Summary of basic debugging steps of S120 driver