【加蛋量化之演讲分享 - 第11期】ETF轮动策略

欧阳
欧阳 This guy is lazy,Introduction has not been set

0 People liked this article · 1833 views

本文章为2024年  PTrade客户创享精英汇(宁波站)的演讲内容分享。

主讲内容为在PTrade系统上实现ETF轮动策略。

压缩包内含PPT1份,程序代码1份。


在Demo程序中你可以学到:

1. tushare库的调用以及数据的获取方式

2. ETF量能的计算及排序

3. 有限状态机管理股票池的买卖和持仓状态

4. 简单的买卖实现回测功能

在这个Demo中您可以按照PPT的讲解,学习程序的总架构和各个模块的写法,尤其是有限状态机的应用、量能计算及排序模块,把它融合到你自己的策略中。

学习使用前请用自己的token码替换策略中初始化tushare接口中的一串 00000000000 的字符串

注:Demo程序仅供学习演示,技术参考和学习交流,不构成任何投资建议,请勿直接用于实盘交易。

如需个性化定制,请在论坛内私信,谢谢。

List of attachments

ETF轮动.zip

5.24MB

288.00

线上付款

Published on 2024-12-30 00:08

Disclaimers:

This document is written by 欧阳 Original published on 百果量化交流平台 ,The copyright belongs to the author。

Log in,More exciting content waiting for you to find,Contribute wonderful answers,Participate in comment interaction

go Sign in! No accountgoregister

Jasonho
2025-01-19 17:57
RROR - Exception: Traceback (most recent call last): File /home/fly/backtest/b64c22ca-d648-11ef-b3ca-d404e6605e50/user_strategy.py, line 69 in before_trading_start sec_share = pro.fund_share(ts_code=ts_sec, start_date=start_date, end_date=end_date) --> context = end_date = \20240118\ --> start_date = \20231123\ --> share_df = Empty DataFrame Columns: [sec, dif_share] Index: [] --> sec = \510300.SS\ --> ts_sec = \510300.SH\ 报错了,啥原因?