[update] 币安数据下载流量控制

This commit is contained in:
msincenselee 2021-08-11 09:25:29 +08:00
parent ab8b9bef24
commit 37ae0134b0

View File

@ -4,6 +4,7 @@ import os
import json import json
from typing import Dict, List, Any from typing import Dict, List, Any
from datetime import datetime, timedelta from datetime import datetime, timedelta
from time import sleep
from vnpy.api.rest.rest_client import RestClient from vnpy.api.rest.rest_client import RestClient
from vnpy.trader.object import ( from vnpy.trader.object import (
Interval, Interval,
@ -150,6 +151,9 @@ class BinanceFutureData(RestClient):
start_dt = end + TIMEDELTA_MAP[req.interval] * req.interval_num start_dt = end + TIMEDELTA_MAP[req.interval] * req.interval_num
start_time = int(datetime.timestamp(start_dt)) start_time = int(datetime.timestamp(start_dt))
# 等待0.1秒
sleep(0.1)
return bars return bars
def get_fund_rate(self, symbol=""): def get_fund_rate(self, symbol=""):