7926858da02bd4db873a9e8ca727beb838faad9d,QUANTAXIS/QAFetch/QAbinance.py,,QA_fetch_binance_symbols,#,22
Before Change
url = urljoin(Binance_base_url, "/api/v1/exchangeInfo")
try:
req = requests.get(url, timeout=TIMEOUT)
except ConnectTimeout:
raise ConnectTimeout(ILOVECHINA)
body = json.loads(req.content)
return body["symbols"]
After Change
url = urljoin(Binance_base_url, "/api/v1/exchangeInfo")
retries = 1
datas = list()
while (retries != 0):
try:
req = requests.get(url, timeout=TIMEOUT)
retries = 0
except (ConnectTimeout, ConnectionError, SSLError, ReadTimeout):
retries += 1
if (retries % 6 == 0):
print(ILOVECHINA)
print("Retry /api/v1/exchangeInfo //{}".format(retries - 1))
time.sleep(0.5)
if (retries == 0):
// 成功获取才处理数据,否则继续尝试连接
body = json.loads(req.content)
if len(body["symbols"]) == 0:
return []
for symbol in body["symbols"]:
// 只导入上架交易对
if (symbol["status"] == "TRADING"):
datas.append(symbol)
return datas
def QA_fetch_binance_kline(symbol, start_time, end_time, frequency):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 7926858da02bd4db873a9e8ca727beb838faad9d
Time: 2020-02-25
Author: 11652964@qq.com
File Name: QUANTAXIS/QAFetch/QAbinance.py
Class Name:
Method Name: QA_fetch_binance_symbols
Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 7926858da02bd4db873a9e8ca727beb838faad9d
Time: 2020-02-25
Author: 11652964@qq.com
File Name: QUANTAXIS/QAFetch/QABitmex.py
Class Name:
Method Name: QA_fetch_bitmex_symbols
Project Name: aleju/imgaug
Commit Name: 2a1bd4c93a998d16516d82893401b346d66a95e9
Time: 2019-07-19
Author: kontakt@ajung.name
File Name: imgaug/dtypes.py
Class Name:
Method Name: get_minimal_dtype