WonderTrade 笔记

  • 安装教程
  1. 创建环境
conda create -n wondertrade python=3.9
conda activate wondertrade
  1. 安装 wtpy
pip install wtpy
  1. 版本重新配置
  • 在未进行版本重新配置时, import 时会提示如下错误
Traceback (most recent call last):
	File "<stdin>", line 1, in <module>
	File "C:\ProgramData\Anaconda3\envs\wondertrade\lib\site-packages\wtpy\__init__.py", line 13, in <module>
		from .WtDtServo import WtDtServo
	File "C:\ProgramData\Anaconda3\envs\wondertrade\lib\site-packages\wtpy\WtDtServo.py", line 5, in <module>
		from flask import Flask, session, redirect, request, make_response
	File "C:\ProgramData\Anaconda3\envs\wondertrade\lib\site-packages\flask\__init__.py", line 19, in <module>
		from . import json
	File "C:\ProgramData\Anaconda3\envs\wondertrade\lib\site-packages\flask\json\__init__.py", line 15, in <module>
		from itsdangerous import json as _json
ImportError: cannot import name 'json' from 'itsdangerous' (C:\ProgramData\Anaconda3\envs\wondertrade\lib\site-packages\itsdangerous\__init__.py)
  • 重新安装
pip uninstall itsdangerous
pip install itsdangerous==2.0.1
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
# easyquant 基于 [easytrader](https://github.com/shidenggui/easytrader) 和 [easyquotation](https://github.com/shidenggui/easyquotation) 的量化交易框架 事件引擎借鉴 交易:支持华泰、佣金宝、银河以及雪球模拟盘 行情:支持新浪免费实时行情,集思路分级基金以及 leverfun 的免费十档行情 ### 微信群以及公众号 欢迎大家扫码关注公众号「食灯鬼」,一起交流。进群可通过菜单加我好友,备注量化。 ![公众号二维码](https://gitee.com/shidenggui/assets/raw/master/uPic/mp-qr.png) 若二维码因 Github 网络无法打开,请点击[公众号二维码](https://gitee.com/shidenggui/assets/raw/master/uPic/mp-qr.png)直接打开图片。 ### 关于行情 默认使用的是 sina 的免费全市场行情,1s 推送一次 可自定义使用的行情来源或者使用 easyquotation的 lf免费十档行情 和 集思路的分级基金行情 具体可参见 [easyquotation](https://github.com/shidenggui/easyquotation) ### 关于交易 具体可参见 [easytrader](https://github.com/shidenggui/easytrader) ### 使用 #### 准备交易账户 在 ht.json 或 yjb.json 或 yh.json 或 xq.json 中填入你的账户相关信息 [如何填写相关信息](https://github.com/shidenggui/easytrader) #### 快速开始 python test.py ### 策略编写 策略用 Python 编写后置于 strategies 文件夹下 格式可参考其中的 Demo #### Hello World # 引入策略模板 from easyquant import StrategyTemplate # 定义策略类 class Strategy(StrategyTemplate): name = 'Hello World' # 定义策略名字 # 策略函数,收到行情推送后会自动调用 def strategy(self, event): """:param event event.data 为所有股票行情的字典,结构如下 {'162411': {'ask1': '0.493', 'ask1_volume': '75500', 'ask2': '0.494', 'ask2_volume': '7699281', 'ask3': '0.495', 'ask3_volume': '2262666', 'ask4': '0.496', 'ask4_volume': '1579300', 'ask5': '0.497', 'ask5_volume': '901600', 'bid1': '0.492', 'bid1_volume': '10765200', 'bid2': '0.491', 'bid2_volume': '9031600', 'bid3': '0.490', 'bid3_volume': '16784100', 'bid4': '0.489', 'bid4_volume': '10049000', 'bid5': '0.488', 'bid5_volume': '3572800', 'buy': '0.492', 'close': '0.499', 'high': '0.494', 'low': '0.489', 'name': '华宝油气', 'now': '0.493', 'open': '0.490', 'sell': '0.493', 'turnover': '420004912', 'volume'

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值