Comments (8)
你自己写错东西了吧 贴下源代码
from ctpbee.
好的,源码有点多,我整理一下
from ctpbee.
_sim_test = {
"userid": "201425",
"password": "BGTbgt54321@",
"brokerid": "9999",
"td_address": "tcp://180.168.146.187:10201",
"md_address": "tcp://180.168.146.187:10211",
"appid": "simnow_client_test",
"auth_code": "0000000000000000",
"product_info": "0000000000000000",
}
def prepare_ctp_api(cfg):
app = CtpBee(_strategy_name, name, refresh=True)
app.config.from_mapping({
"CONNECT_INFO": ctp_cfg_sim_test, #ctp_cfg_tts_test,ctp_cfg_zt_test,ctp_cfg_real_zt
"INSTRUMENT_INDEPEND": True,
"INTERFACE": "ctp", # 接口声明
"TD_FUNC": True, # 开启交易功能
"MD_FUNC": True,
"XMIN": [1],
"LOG_OUTPUT":True
})
strategy = HsCtpApi(_strategy_name, app, cfg)
app.add_extension(strategy)
app.start()
return strategy
from ctpbee.
额 不推荐start之后再返回了 推荐返回app 然后在外层 .start()
然后你装的版本是 哪个版本 ? pip安装的?
from ctpbee.
ctpbee :1.5.2
我是下载的ctpbee, ctpbee_api 到本地,运行的。
因为 dll 版本的原因,需要重新编译pyd文件
from ctpbee.
感觉信息还不太够。。。 你看看能不能传一个完整的demo吧
from ctpbee.
我找到原因了,是生成的pyd 文件与dll 不匹配导致的。感谢你的回复
from ctpbee.
ok的 。。。
from ctpbee.
Related Issues (20)
- “平昨仓位不足”应该怎么处理? HOT 5
- INTERFACE 的参数值ctp_se不存在 HOT 11
- 使用PATTERN为looper回测时候调用self.app.center.account一直为空 HOT 4
- get_main_contract_by_code(‘RB’)不起作用 HOT 1
- on_account不触发 HOT 2
- LOG_OUTPUT日志设置似乎不起作用 HOT 2
- 如何知道调用self.action.buy_open等下单操作是否完成成交? HOT 1
- mac版最新安装还是报错 HOT 1
- 23.02.24 macos下,dev版本启动成功后1s内核立刻挂掉 HOT 20
- 交易日2023 04-03 04-04 出错 HOT 6
- 什么版本能正常安装 HOT 9
- 符号找不到 HOT 3
- 无法触发bar数据 HOT 4
- 持仓数据是通过查询交易所得到的,还是本地不断累加得到的? HOT 1
- 运行快速开始里面的例子,出现如下提示DesignError:empty location for service name in line 18 of file ..\..\source\network\ServiceName.cpp HOT 1
- 交易所对信息量有限制,有没有自动计算信息量的函数?还有,在买入卖出发出后,当这笔订单没有到达交易所这段时间,它会出现在订单列表吗?如果没有,如何防止重复发单? HOT 4
- 对交易和行情在触发上的独立性的咨询 HOT 1
- buy和sell这些函数,是不是没有办法发送FAK订单? HOT 2
- 关于安装问题 HOT 2
- 执行 examples/send_order_demo.py 报错 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ctpbee.