We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from vnpy_evo.event import EventEngine from vnpy_evo.trader.engine import MainEngine from vnpy_binance import BinanceSpotGateway, BinanceLinearGateway, BinanceInverseGateway from vnpy.trader.object import HistoryRequest,Interval from vnpy.trader.constant import Interval from datetime import datetime, timedelta from vnpy_evo.trader.constant import Exchange # 初始化事件引擎和主引擎 event_engine = EventEngine() main_engine = MainEngine(event_engine) # 加载 Binance 网关 main_engine.add_gateway(BinanceSpotGateway) main_engine.add_gateway(BinanceLinearGateway) main_engine.add_gateway(BinanceInverseGateway) gateway_names = main_engine.get_all_gateway_names() print(gateway_names) # 设置 Binance 的 REST 和 WebSocket 地址 main_engine.connect({ "apiKey": "", "secretKey": "", "sessionCount": 3, "server": "REAL", # 或 "TEST" 用于测试环境 "proxy_host": "127.0.0.1", # 代理服务器地址 "proxy_port": 7890, # 代理服务器端口 "base_url": "https://api.binance.com" }, "BINANCE") # 定义查询条件 history_req = HistoryRequest( symbol="BTC-USDT", # 合约代码 exchange=Exchange.BINANCE, # 交易所代码 start=datetime(2024, 12, 1), # 开始时间 end=datetime(2024, 12, 31), # 结束时间 interval=Interval.MINUTE # 时间间隔 ) bardatalist = main_engine.query_history(history_req, gateway_name="BINANCE_SPOT") print(bardatalist)。
报错: 发生异常: MissingSchema Invalid URL '/api/v3/klines': No scheme supplied. Perhaps you meant https:///api/v3/klines? File "D:\1-编程学习\3-自己做的任务\5.2vnpy国际版2025-2-25\test_vnpy2-重点.py", line 43, in bardatalist = main_engine.query_history(history_req, gateway_name="BINANCE_SPOT") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requests.exceptions.MissingSchema: Invalid URL '/api/v3/klines': No scheme supplied. Perhaps you meant https:///api/v3/klines?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
报错:
发生异常: MissingSchema
Invalid URL '/api/v3/klines': No scheme supplied. Perhaps you meant https:///api/v3/klines?
File "D:\1-编程学习\3-自己做的任务\5.2vnpy国际版2025-2-25\test_vnpy2-重点.py", line 43, in
bardatalist = main_engine.query_history(history_req, gateway_name="BINANCE_SPOT")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
requests.exceptions.MissingSchema: Invalid URL '/api/v3/klines': No scheme supplied. Perhaps you meant https:///api/v3/klines?
The text was updated successfully, but these errors were encountered: