今日策略:年化436%,回撤7%,夏普比5.28, deap因子挖掘重构,附python代码

原创内容第1008篇,专注AGI+,AI量化投资、个人成长与财富自由。

今日策略:年化436%,回撤7%,夏普比5.28

策略地址:

http://www.ailabx.com/strategy/68c8d246fd408079e03bcf63

今天开始,我们在重构的因子表达式的基础上,重构咱们的因子挖掘系统,还是基于deap。

对于gplearn,deap天然支持多支标的,支持常数项。

复制代码
def _random_int_():    import random    return random.choice([1, 5, 10, 20, 25,30, 40, 60, 120])
def add_unary_ops(pset):    unary_funcs = ['ts_log','ts_abs','cs_rank','cs_std','cs_mean']    for func in unary_funcs:        pset.addPrimitive(dummy, [EXPR], EXPR, name=func)

但自定义函数里,需要把函数及参数告诉它。

把函数注册到deap里,这里后续实现自动表达式生成:

复制代码
def add_ops(pset):    from datafeed import factor_extends    from typing import get_type_hints    for method_name in dir(factor_extends):        if not method_name.startswith('_'):            method = getattr(factor_extends, method_name)            if callable(method):                type_hints = get_type_hints(method)                print(method_name,type_hints)                inputs = []                for p_name,p_type in type_hints.items():
                    if p_type is pd.Series:                        inputs.append(EXPR)                    else:                        inputs.append(int)                print(inputs)                pset.addPrimitive(dummy, inputs, EXPR, name=method_name)

明天继续因子挖掘。

吾日三省吾身

就事论事,其实就简单。

还能怎么着呢,想回应就回应一下,不想回应就直接无视。

如此而已。

话不投机半句多。

做好自己的事情。

不必理会,更不必介入别人的因果。

眼里有自己的诗和远方,星辰大海。

再进一步,最好是建议两个智能体团队,完成大部分的事情,比如文章,视频等,既是内容,也是流量。

每天"不管"一点点,每天就变强一天天。

年化390%,回撤7%,夏普6.32 | A股量化策略配置

年化30.24%,最大回撤19%,综合动量多因子评分策略再升级(python代码+数据)

年化429%,夏普5.51 | 全A股市场回测引擎构建

年化443%,回撤才7%,夏普5.53,3积分可查看策略参数

相关推荐
sqyno1sky3 小时前
Python数据库操作:SQLAlchemy ORM指南
jvm·数据库·python
Yupureki3 小时前
《Linux系统编程》12.基础IO
linux·运维·c语言·开发语言·数据库·c++
淮北4943 小时前
bash下好用的快捷键以及linux常用指令
linux·开发语言·ubuntu·bash
belldeep3 小时前
python:spaCy 源代码解析,性能优化方法
python·性能优化·cython·spacy
deephub4 小时前
TPU 架构与 Pallas Kernel 编程入门:从内存层次结构到 FlashAttention
人工智能·python·深度学习·tpu
薛定谔的猫喵喵4 小时前
卸载 Python 3.8 报错 “Could not set file security” 的终极解决方案
开发语言·python
墨尔本、晴4 小时前
[Django-web]1.环境准备
python·django
看山是山_Lau4 小时前
代码命名规范原则与原理
c语言·开发语言
_MyFavorite_4 小时前
JAVA重点基础、进阶知识及易错点总结(8)List 接口(ArrayList、LinkedList、Vector)
java·开发语言·list