Giter Club home page Giter Club logo

use-gplearn-to-generate-cta-factor's Introduction

use-gplearn-to-generate-CTA-factor

本文档使用gplearn模型进行因子生成。
在适应度函数定义方面,本文档采用收益回撤比进行定义。如何根据遗传规划算法得到因子值投资的细节参见simple-backtest部分。

主要文档说明

主要包含三个文档,依次为:

bkt_main.py

该文档是向量化回测框架的演示文档。在这里,汇总了从因子信号到仓位变换一直到最后的统计结果输出部分(输出结果被保存在bkt_rslt文件夹中)。这部分为遗传规划中适应度函数的定义提供了标准。

gp_basic.py

该文档是对遗传规划算法的演示文档。在该文档中,演示了遗传规划之下是如何逐渐逼近真实函数的。这部分为遗传规划中相关过程提供参照。
预计运行时间为1.6s

gp_main.py

该文档是通过遗传规划生成因子的详细过程。因为在进行这一操作时需要输入参数,因子该文档被最终设计为半自动化的因子生成过程。具体地,每次开始遗传规划前首先给定相关参数,之后根据训练集和测试集回测结果判断是否保存结果,以及是否进入下次循环(输出结果保存在gp_rslt中)。
在推荐参数设定下,预计运行时间为54s

版本历史说明

该文档共有三个版本。

230215 版本1通过input函数实现半自动化调参和结果保存,方便使用。

  • 预计单次回测及生成统计量运行时间为1.6s
  • 预计单次回测及生成统计量和图表运行时间为4.4s

230215 版本2需要手动在gp_main.py中调整选取参数,方便学习。

  • 预计单次回测及生成统计量运行时间为1.6s
  • 预计单次回测及生成统计量和图表运行时间为4.4s

230301 版本3在回测部分增加了止损限制。当单笔交易损失超过设定值后停止交易。

  • 1
  • 1
  • stop_loss = 0.96, stop_gain = 1.5

具体版本可以通过git切换.

use-gplearn-to-generate-cta-factor's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.