VeighNa量化社区
你的开源社区量化交易平台
swordman's Avatar
Member
离线
3 帖子
声望: 0

在Jupyter模式模式下,运行engine.buy(vt_symbol = "rb2001.SHFE",price = "3539",volume = "1",order_type=OrderType.LIMIT)
运行结果如下:
NameError Traceback (most recent call last)

<ipython-input-52-694b0f0f4424> in <module>
----> 1 engine.buy(vt_symbol = "rb2001.SHFE",price = "3539",volume = "1",order_type=OrderType.LIMIT)

NameError: name 'OrderType' is not defined

from vnpy.app.script_trader import init_cli_trading
from vnpy.gateway.ctp import CtpGateway
engine = init_cli_trading([CtpGateway])
setting = {
"用户名": "xxxx",
"密码": "xxxx",
"经纪商代码": "9999",
"交易服务器":"tcp://180.168.146.187:10101",
"行情服务器":"tcp://180.168.146.187:10111",
"产品名称":"simnow_xxx_test",
"授权编码":"0000000000000000",
"产品信息": ""
}
engine.connect_gateway(setting,"CTP")
上述运行后没有任何信息输出?

© 2015-2022 微信 18391752892
备案服务号:沪ICP备18006526号

沪公网安备 31011502017034号

【用户协议】
【隐私政策】
【免责条款】