
Python与CTP
5星
- 浏览量: 0
- 大小:None
- 文件类型:BZ2
简介:
本课程介绍如何使用Python编程语言连接和操作CTP(中国金融期货交易所交易网关),进行金融数据处理及量化交易策略开发。
在Python中封装CTP接口的代码如下:
```python
def main():
user = MdApi.CreateMdApi(data)
user.RegisterSpi(myMdSpi(instruments=inst,
broker_id=2030,
investor_id=00092,
passwd=888888))
user.RegisterFront(tcp://asp-sim2-md1.financial-trading-platform.com:26213)
user.Init()
while True:
time.sleep(1)
```
这里对`investor_id`和`passwd`进行了字符串化处理,以确保安全性和规范性。
全部评论 (0)
还没有任何评论哟~


