Type/to search

获取和讯期货数据(Python版本)

Python
0
Follow
3
Followers

数狂很早之前写了个js版本的第三方数据获取,我照着他的改写了个python版本的,可以下在云服务器上引入自己的包,这样研究时候也可以用。
update 12.01 和讯接口有变化多了60分钟和周线的信息,原版选择1440会获取60分钟的k线,这里fix了

Source
Python
#coding: utf-8
import urllib2 as url
import json
import time

def hxRecords(instrument,timeFrame=1,size=1,includeLastBar=True,to_df=True):
    ##从和讯获取期货实时数据
    pInst=instrument.lower()
    if pInst[-4]!='1':
        pInst=pInst[:-3]+'1'+pInst[-3:]
    xchg=None
    for i in instList:
Comment
All comments (1)

    这个很有用, 和讯的数据还是比较有权威的, 支持开源 !!!

    10 years ago
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)