veighna-global / vnpy_okx Goto Github PK
View Code? Open in Web Editor NEWOKX trading gateway for VeighNa Evo
License: MIT License
OKX trading gateway for VeighNa Evo
License: MIT License
缺少default_name导致会出现找不到gateway的错误
应该加上:
class OkexGateway(BaseGateway):
default_name: str = "OKEX"
default_setting = {
"API Key": "",
"Secret Key": "",
"Passphrase": "",
"会话数": 3,
"代理地址": "",
"代理端口": "",
"服务器": ["REAL", "TEST"]
}
完整报错如下,麻烦大神们帮帮忙,感谢
File "/Users/xiaofeiwang/Documents/Quant/vnpy_okex-main/run.py", line 5, in
from vnpy_okex import OkexGateway
File "/Users/xiaofeiwang/Documents/Quant/vnpy_okex-main/vnpy_okex/init.py", line 25, in
from .okex_gateway import OkexGateway
File "/Users/xiaofeiwang/Documents/Quant/vnpy_okex-main/vnpy_okex/okex_gateway.py", line 119, in
class OkexGateway(BaseGateway):
File "/Users/xiaofeiwang/Documents/Quant/vnpy_okex-main/vnpy_okex/okex_gateway.py", line 133, in OkexGateway
exchanges: Exchange = [Exchange.OKEX]
File "/Users/xiaofeiwang/opt/anaconda3/envs/py37_vnpy/lib/python3.9/enum.py", line 429, in getattr
raise AttributeError(name) from None
AttributeError: OKEX
buy或sell后vt_orderid返回为空,我看了下,okex_gateway.py 中904行
return order.vt_orderid
OrderData结构没有vt_orderid变量,改为
return order.orderid
后返回正常
okex里最小购买量与交易数量精度是分开的,有
lotSz | String | 下单数量精度,如 BTC-USDT-SWAP:1
minSz | String | 最小下单数量
但是cta_engine.send_order里是使用minSz来修正精度的,会导致卖出失败。比如eth的最小下单数为0.01,但是交易精度有1e-6
正常填写settins中的字段,会报错
公共频道触发异常,类型:<class 'aiohttp.client_exceptions.ClientConnectorError'>,信息:Cannot connect to host wspap.okex.com:8443 ssl:False [信号灯超时时间已到]
和
私有频道触发异常,类型:<class 'aiohttp.client_exceptions.ClientConnectorError'>,信息:Cannot connect to host wspap.okex.com:8443 ssl:False [信号灯超时时间已到]
现在3.0版本怎么添加这个接口呀
3.0的版本怎么添加?
Can you provide a manual for the use of the OKEX module, such as the configuration meaning and usage process?
okex 合约中新增的一个参数。
ctVal 合约面值应该理解为原有的合约乘数吧? 拥有反向合约 计价单位为 张 时使用
ctMult 合约乘数。应该作为统一账户中按照 计价单位为 币 时使用
在差价计算中
买入 [email protected] crv 使用 64.98 usdt
对应应该卖出 6.4 张合约 而非 64 张.
币本位计算中 64张合约价值是640 u
在连接okex后,订阅ETH-USDT-SWAP行情,10分钟后不会接收到任何数据(账户、行情和订单)。对比币安,可以正常接收到数据。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.