今日策略:年化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积分可查看策略参数

相关推荐
孟健21 小时前
Karpathy 用 200 行纯 Python 从零实现 GPT:代码逐行解析
python
码路飞1 天前
写了个 AI 聊天页面,被 5 种流式格式折腾了一整天 😭
javascript·python
曲幽1 天前
FastAPI压力测试实战:Locust模拟真实用户并发及优化建议
python·fastapi·web·locust·asyncio·test·uvicorn·workers
敏编程1 天前
一天一个Python库:jsonschema - JSON 数据验证利器
python
前端付豪1 天前
LangChain记忆:通过Memory记住上次的对话细节
人工智能·python·langchain
databook1 天前
ManimCE v0.20.1 发布:LaTeX 渲染修复与动画稳定性提升
python·动效
花酒锄作田2 天前
使用 pkgutil 实现动态插件系统
python
前端付豪2 天前
LangChain链 写一篇完美推文?用SequencialChain链接不同的组件
人工智能·python·langchain
曲幽2 天前
FastAPI实战:打造本地文生图接口,ollama+diffusers让AI绘画更听话
python·fastapi·web·cors·diffusers·lcm·ollama·dreamshaper8·txt2img
老赵全栈实战2 天前
Pydantic配置管理最佳实践(一)
python