d262a0d3c567cf0543760bd238f67411acb697c2,QUANTAXIS/QAFetch/QAhuobi.py,,QA_fetch_huobi_kline,#Any#Any#Any#Any#Any#,130
Before Change
break
if (retries == 0):
// 成功获取才处理数据,否则继续尝试连接
if (len(klines) == 0) or \
(end_time == klines[-1].id) or \
(start_time == klines[0].id):
break
// 转换成DICT,mongodb不接受专有类型
for kline in klines:
time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(kline.id))
datas.append(kline.__dict__)
// 狗日huobi.pro的REST API kline时间戳排序居然是倒序向前获取,必须从后向前获取,而且有数量限制,Request
// < 2000,
if len(datas) == 0:
return None
// 归一化数据字段,转换填充必须字段,删除多余字段
After Change
datas = list()
retries = 1
url = urljoin(Huobi_base_url,
"/market/history/kline?symbol={:s}&period={:s}&siz={:d}".format(symbol, frequency, 2000))
while (retries != 0):
try:
req = requests.get(url, timeout=TIMEOUT)
// 防止频率过快被断连
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: QUANTAXIS/QUANTAXIS
Commit Name: d262a0d3c567cf0543760bd238f67411acb697c2
Time: 2020-02-26
Author: 11652964@qq.com
File Name: QUANTAXIS/QAFetch/QAhuobi.py
Class Name:
Method Name: QA_fetch_huobi_kline
Project Name: comic/grand-challenge.org
Commit Name: 4cecfce9ce7e30eb0a1b952d63986785c0806034
Time: 2017-12-06
Author: jamesmeakin@gmail.com
File Name: app/comicsite/core/urlresolvers.py
Class Name:
Method Name: reverse
Project Name: comic/grand-challenge.org
Commit Name: 87410f44a11fcd8366cb0ec74c82b74cef5d428a
Time: 2018-11-29
Author: jamesmeakin@gmail.com
File Name: app/grandchallenge/subdomains/urls.py
Class Name:
Method Name: reverse