当前位置: 首页 > article >正文

年化33.9%的稳健策略 | streamlit和dash驱动的智能量化投研(python代码+数据)

原创内容第836篇,专注智能量化投资、个人成长与财富自由。

aitrader5.0继续开发。

aitrader代码发布,支持双引擎。(代码+数据下载)

之前我们写过双引擎:streamlit+ dash,现在加一个引擎就是toga+pyecharts。

图片

股票智能投研的界面:

图片

通过main启动界面引擎:

from multiprocessing import Process

import dash
import toga
from toga.constants import WindowState
from toga.style import Pack
from gui.tab_dashboard import create_dashboard
from gui.tab_datadownload import create_tab
from zvt.main import serve_layout


class LabxApp(toga.App):


    def create_datas_tab(self):
        data_box = toga.Box()


        return data_box

    def create_tabs(self):

        webview = toga.WebView(
            url="http://www.ailabx.com/mall",
            # on_webview_load=self.on_webview_load,
            style=Pack(flex=1),
        )

        streamlit_webview = toga.WebView(
            url="http://localhost:8501",
            # on_webview_load=self.on_webview_load,
            style=Pack(flex=1),
        )

        dash_webview = toga.WebView(
            url="http://localhost:8050",
            # on_webview_load=self.on_webview_load,
            style=Pack(flex=1),
        )

        tabs = [("策略优选", webview),
                ('ETF基金智能投研', streamlit_webview),
                ('股票智能投研', dash_webview),
                ("金融数据下载", create_tab()),
                ("市场看板", create_dashboard())
                ]

        self.optioncontainer = toga.OptionContainer(
            content=tabs,
            style=Pack(margin_bottom=20, flex=1, margin=10)
        )
        return self.optioncontainer

    def startup(self):
        """Construct and show the Toga application.

        Usually, you would add your application to a main content box.
        We then create a main window (with a name matching the app), and
        show the main window.
        """
        main_box = toga.Box()

        self.main_window = toga.MainWindow(title=self.formal_name)
        self.main_window.content = self.create_tabs()

        self.main_window.show()
        self.main_window.state = WindowState.MAXIMIZED

def main():
    return LabxApp("aitrader_AI量化投资实验室", "com.ailabx",author = "飞狐", home_page = "http://www.ailabx.com")

def run_streamlit():
    import subprocess, os
    streamlit_file = os.path.join(os.path.dirname(__file__), 'gui', 'streamlit_main.py')
    p_restart = subprocess.Popen(["streamlit", "run", streamlit_file])
    return p_restart


from zvt.ui import zvt_app
def run_dash():
    zvt_app.layout = serve_layout

    zvt_app.run(port=8050)

if __name__ == "__main__":

    # 启动 Streamlit
    p = run_streamlit()
    dash_process = Process(target=run_dash)
    dash_process.start()
    main().main_loop()
    p.kill()
    dash_process.kill()

吾日三省吾身

天下本无事,庸人自扰之。

大胆一点,世间是一个巨大的游乐场,勇敢去体验。

守好底线,认真生活。

代码和数据下载:AI量化实验室——2025量化投资的星辰大海

AI量化实验室 星球,已经运行三年多,1500+会员。

aitrader代码,因子表达式引擎、遗传算法(Deap)因子挖掘引等,支持vnpy,qlib,backtrader和bt引擎,内置多个年化30%+的策略,每周五迭代一次,代码和数据在星球全部开源。

图片

扩展  •  历史文章   

EarnMore(赚得更多)基于RL的投资组合管理框架:一致的股票表示,可定制股票池管理。(附论文+代码)
deap系统重构,再新增一个新的因子,年化39.1%,卡玛提升至2.76(附python代码)

aitrader_v4.6代码发布,支持duckdb|股票全量数据(python代码+数据)

年化19.66%,回撤12%的稳健策略|manus的启发:基于大模型多智能体的智能投研系统(python代码+数据)

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

年化18%-39.3%的策略集 | backtrader通过xtquant连接qmt实战


http://www.kler.cn/a/613156.html

相关文章:

  • 刘裕的简介
  • macOS 制作dmg磁盘映像安装包
  • 【PDF提取指定区域内容保存表格】提取PDF电子单据内容,将内容保存为表格并将内容组合进行批量改名操作,基于C++的方式快速实现
  • 头歌 | Linux之用户高级管理
  • 深入解析 TypeScript 核心配置文件 tsconfig.json
  • Spring Boot 3.2性能优化:响应速度提升50%方案
  • 使用multiprocessing
  • 记录一次交易耗时有毛刺TDSQL数据库排查过程
  • ResNet(残差网络)中的残差是什么?
  • 网盘解析工具1.3.0,修改了一些bug,建议更新到此版本
  • OpenCV 图形API(或称G-API)
  • 小型水库大坝安全及水雨情监测技术方案
  • 第 8 章:使用更好的库_《C++性能优化指南》_notes
  • 数据库——MySQL字符、日期函数
  • 字符串相加和字符串相乘
  • 通过Map类和List类的List<Map<>>组合类体会JSON
  • 7. 实现命名路由和反向路由
  • windows第十八章 菜单、工具栏、状态栏
  • leetcode102 二叉树的层次遍历 递归
  • [贪心算法] 加油站 单调递增的数字 坏了的计算器 合并区间 无重叠区间