Merge pull request #1928 from lostleaf/master
修正 MainEngine 中 app_class, gateway_class 的 type hint
This commit is contained in:
commit
2f247d8ada
126
docs/gateway.md
126
docs/gateway.md
@ -75,12 +75,14 @@ def main():
|
||||
| -------- | :----------------------------------------: |
|
||||
| CTP | 期货 |
|
||||
| FEMAS | 期货 |
|
||||
| OES | 国内股票 |
|
||||
| XTP | 国内股票、指数、基金、债券、期权、融资融券 |
|
||||
| OES | 国内股票 |
|
||||
| TORA | 国内股票 |
|
||||
| IB | 外盘股票、期货、期权 |
|
||||
| TAP | 外盘股票、期货、期权 |
|
||||
| TAP | 外盘期货、期权 |
|
||||
| FUTU | 国内股票、港股、美股 |
|
||||
| TIGER | 国内股票、港股、美股 |
|
||||
| ALPACA | 美股 |
|
||||
| BITFINEX | 数字货币 |
|
||||
| BITMEX | 数字货币 |
|
||||
| OKEX | 数字货币 |
|
||||
@ -88,6 +90,7 @@ def main():
|
||||
| HUOBI | 数字货币 |
|
||||
| HBDM | 数字货币 |
|
||||
| ONETOKEN | 数字货币 |
|
||||
| RPC | RPC服务 |
|
||||
|
||||
|
||||
|
||||
@ -162,45 +165,6 @@ main_engine.add_gateway(FemasGateway)
|
||||
|
||||
|
||||
|
||||
### 宽睿柜台(OES)
|
||||
|
||||
#### 如何加载
|
||||
|
||||
先从gateway上调用OesGateway类;然后通过add_gateway()函数添加到main_engine上。
|
||||
```
|
||||
from vnpy.gateway.oes import OesGateway
|
||||
main_engine.add_gateway(OesGateway)
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
#### 相关字段
|
||||
|
||||
- 用户名:username
|
||||
- 密码:password
|
||||
- 硬盘序列号:hdd_serial
|
||||
- 交易委托服务器:td_ord_server
|
||||
- 交易回报服务器:td_rpt_server
|
||||
- 交易查询服务器:td_qry_server
|
||||
- 行情推送服务器:md_tcp_server
|
||||
- 行情查询服务器:md_qry_server
|
||||
|
||||
|
||||
|
||||
|
||||
#### 获取账号
|
||||
|
||||
测试账号请联系宽睿科技申请
|
||||
|
||||
|
||||
|
||||
#### 其他特点
|
||||
|
||||
宽睿柜台提供内网UDP低延时组播行情以及实时成交信息推送。
|
||||
|
||||
|
||||
|
||||
### 中泰柜台(XTP)
|
||||
|
||||
#### 如何加载
|
||||
@ -240,6 +204,58 @@ XTP是首家提供融资融券的极速柜台。
|
||||
|
||||
|
||||
|
||||
### 宽睿柜台(OES)
|
||||
|
||||
#### 如何加载
|
||||
|
||||
先从gateway上调用OesGateway类;然后通过add_gateway()函数添加到main_engine上。
|
||||
```
|
||||
from vnpy.gateway.oes import OesGateway
|
||||
main_engine.add_gateway(OesGateway)
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
#### 相关字段
|
||||
|
||||
- 用户名:username
|
||||
- 密码:password
|
||||
- 硬盘序列号:hdd_serial
|
||||
- 交易委托服务器:td_ord_server
|
||||
- 交易回报服务器:td_rpt_server
|
||||
- 交易查询服务器:td_qry_server
|
||||
- 行情推送服务器:md_tcp_server
|
||||
- 行情查询服务器:md_qry_server
|
||||
|
||||
|
||||
|
||||
|
||||
#### 获取账号
|
||||
|
||||
测试账号请联系宽睿科技申请
|
||||
|
||||
|
||||
|
||||
#### 其他特点
|
||||
|
||||
宽睿柜台提供内网UDP低延时组播行情以及实时成交信息推送。
|
||||
|
||||
|
||||
|
||||
|
||||
### 华鑫奇点(TORA)
|
||||
|
||||
#### 如何加载
|
||||
|
||||
#### 相关字段
|
||||
|
||||
#### 获取账号
|
||||
|
||||
#### 其他特点
|
||||
|
||||
|
||||
|
||||
### 盈透证券(IB)
|
||||
|
||||
#### 如何加载
|
||||
@ -278,7 +294,7 @@ main_engine.add_gateway(IbGateway)
|
||||
|
||||
|
||||
|
||||
### TAP
|
||||
### 易盛外盘(TAP)
|
||||
|
||||
#### 如何加载
|
||||
|
||||
@ -381,6 +397,19 @@ main_engine.add_gateway(TigerGateway)
|
||||
|
||||
|
||||
|
||||
### ALPACA
|
||||
|
||||
#### 如何加载
|
||||
|
||||
#### 相关字段
|
||||
|
||||
#### 获取账号
|
||||
|
||||
#### 其他特点
|
||||
|
||||
|
||||
|
||||
|
||||
### BITMEX
|
||||
|
||||
#### 如何加载
|
||||
@ -626,4 +655,17 @@ main_engine.add_gateway(OnetokenGateway)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### RPC
|
||||
|
||||
#### 如何加载
|
||||
|
||||
#### 相关字段
|
||||
|
||||
#### 获取账号
|
||||
|
||||
#### 其他特点
|
||||
|
||||
|
@ -9,7 +9,7 @@ from datetime import datetime
|
||||
from email.message import EmailMessage
|
||||
from queue import Empty, Queue
|
||||
from threading import Thread
|
||||
from typing import Any, Sequence
|
||||
from typing import Any, Sequence, Type
|
||||
|
||||
from vnpy.event import Event, EventEngine
|
||||
from .app import BaseApp
|
||||
@ -63,7 +63,7 @@ class MainEngine:
|
||||
self.engines[engine.engine_name] = engine
|
||||
return engine
|
||||
|
||||
def add_gateway(self, gateway_class: BaseGateway):
|
||||
def add_gateway(self, gateway_class: Type[BaseGateway]):
|
||||
"""
|
||||
Add gateway.
|
||||
"""
|
||||
@ -77,7 +77,7 @@ class MainEngine:
|
||||
|
||||
return gateway
|
||||
|
||||
def add_app(self, app_class: BaseApp):
|
||||
def add_app(self, app_class: Type[BaseApp]):
|
||||
"""
|
||||
Add app.
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user