[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-tradytics--eiten":3,"tool-tradytics--eiten":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",150037,2,"2026-04-10T23:33:47",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":73,"owner_location":76,"owner_email":77,"owner_twitter":72,"owner_website":78,"owner_url":79,"languages":80,"stars":89,"forks":90,"last_commit_at":91,"license":92,"difficulty_score":32,"env_os":93,"env_gpu":94,"env_ram":93,"env_deps":95,"category_tags":105,"github_topics":106,"view_count":32,"oss_zip_url":77,"oss_zip_packed_at":77,"status":17,"created_at":120,"updated_at":121,"faqs":122,"releases":158},6455,"tradytics\u002Feiten","eiten","Statistical and Algorithmic Investing Strategies for Everyone","Eiten 是一款由 Tradytics 开源的投资策略工具箱，旨在让每个人都能轻松构建基于统计和算法的投资组合。它解决了普通投资者难以量化选股、缺乏专业回测框架以及无法科学验证策略有效性的痛点。通过内置的特征组合（Eigen Portfolios）、最小方差、最大夏普比率及遗传算法等多种成熟策略，Eiten 能帮助用户从自选股票池中生成有望跑赢市场的投资组合。\n\n这款工具特别适合具备一定编程基础的开发者、量化金融研究人员以及对算法交易感兴趣的高级个人投资者使用。其独特亮点在于严谨的测试框架：不仅支持利用雅虎财经数据灵活加载不同粒度（从分钟级到日线）的历史行情，还集成了蒙特卡洛模拟来预测未来价格走势。更关键的是，Eiten 原生支持“样本外测试”，即自动预留部分最新数据用于向前验证，从而避免过拟合，让用户对策略的真实表现更有信心。只需简单配置股票列表和参数，用户即可在本地完成从策略生成到性能对比的全流程分析。","\u003Cp align=\"center\">\n  \u003Cimg width=\"325\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftradytics_eiten_readme_f94a5390f450.png\">\n\u003C\u002Fp>\n\n# Eiten - Algorithmic Investing Strategies for Everyone\nEiten is an open source toolkit by [Tradytics](https:\u002F\u002Fwww.tradytics.com\u002F) that implements various statistical and algorithmic investing strategies such as **Eigen Portfolios**, **Minimum Variance Portfolios**, **Maximum Sharpe Ratio Portfolios**, and **Genetic Algorithms** based Portfolios. It allows you to build your own portfolios with your own set of stocks that can beat the market. The rigorous testing framework included in Eiten enables you to have confidence in your portfolios.\n\nIf you are looking to discuss these tools in depth and talk about more tools that we are working on, please feel free to join our [Discord](https:\u002F\u002Fdiscord.gg\u002FQuvE2Z8) channel where we have a bunch of more tools too.\n\n### Files Description\n| Path | Description\n| :--- | :----------\n| eiten | Main folder.\n| &boxur;&nbsp; figures | Figures for this github repositories.\n| &boxur;&nbsp; stocks | Folder to keep your stock lists that you want to use to create your portfolios.\n| &boxur;&nbsp; strategies | A bunch of strategies implemented in python.\n| backtester.py | Backtesting module that both backtests and forward tests all portfolios.\n| data_loader.py | Module for loading data from yahoo finance.\n| portfolio_manager.py | Main file that takes in a bunch of arguments and generates several portfolios for you.\n| simulator.py | Simulator that uses historical returns and monte carlo to simulate future prices for the portfolios.\n| strategy_manager.py | Manages the strategies implemented in the 'strategies' folder.\n\n## Required Packages \nYou will need to install the following package to train and test the models.\n- [Scikit-learn](https:\u002F\u002Fscikit-learn.org\u002F)\n- [Numpy](https:\u002F\u002Fnumpy.org\u002F)\n- [Tqdm](https:\u002F\u002Fgithub.com\u002Ftqdm\u002Ftqdm)\n- [Yfinance](https:\u002F\u002Fgithub.com\u002Franaroussi\u002Fyfinance)\n- [Pandas](https:\u002F\u002Fpandas.pydata.org\u002F)\n- [Scipy](https:\u002F\u002Fwww.scipy.org\u002Finstall.html)\n\nYou can install all packages using the following command. Please note that the script was written using python3.\n\n```\npip install -r requirements.txt\n```\n\n## Build your portfolios\nLet us see how we can use all the strategies given in the toolkit to build our portfolios. The first thing you need to do is modify the **stocks.txt** file in the **stocks** folder and add the stocks of your choice. It is recommended to keep the list small i.e anywhere between **5 to 50** stocks should be fine. We have already put a small stocks list containing a bunch of tech stocks like AAPL, MSFT, TSLA etc. Let us build our portfolios now. This is the main command that you need to run.\n\n```\npython portfolio_manager.py --is_test 1 --future_bars 90 --data_granularity_minutes 3600 --history_to_use all --apply_noise_filtering 1 --market_index QQQ --only_long 1 --eigen_portfolio_number 3 --stocks_file_path stocks\u002Fstocks.txt\n```\n\nThis command will use last 5 years of daily data excluding the last 90 days and build several portfolios for you. Based on those portfolios, it will then test them on the out of sample data of 90 days and show you the performance of each portfolio. Finally, it will also compare the performance with your choice of market index which is **QQQ** here. Let's dive into each of the parameters in detail.\n- **is_test**: The value determined if the program is going to keep some separate data for future testing. When this is enabled, the value of **future_bars** should be larger than 5.\n- **future_bars**: These are the bars that the tool will exclude during portfolio building and will forward test the portfolios on the excluded set. This is also called out of sample data.\n- **data_granularity_minutes**: How much granular data do you want to use to build your portfolios. For long term portfolios, you should use daily data but for short term, you can use hourly or minute level data. The possible values here are **3600, 60, 30, 15, 5, 1.** 3600 means daily.\n- **history_to_use**: Whether to use a specific number of historical bars or use everything that we receive from yahoo finance. For minute level data, we only receive up to one month of historical data. For daily, we receive 5 years worth of historical data. If you want to use all available data, the value should be **all** but if you want to use smaller history, you can set it to an integer value e.g **100** which will only use the last 100 bars to build the portfolios.\n- **apply_noise_filtering**: This uses [random matrix theory](http:\u002F\u002Ffaculty.baruch.cuny.edu\u002Fjgatheral\u002Frandommatrixcovariance2008.pdf) to filter out the covariance matrix from randomness thus yielding better portfolios. A value of 1 will enable it and 0 will disable it.\n- **market_index**: Which index do you want to use to compare your portfolios. This should mostly be **SPY** but since we analyzed tech stocks, we used **QQQ**.\n- **only_long**: Whether to use long only portfolio or enable short selling as well. Long only portfolios have shown to have better performance using algorithmic techniques.\n- **eigen_portfolio_number**: Which eigen portfolio to use. Any value between 1-5 should work. The first eigen portfolio (1) represents the market portfolio and should act just like the underlying index such as SPY or QQQ. The second one is orthogonal and uncorrelated to the market and poses the greatest risk and reward. The following ones have reduced risk and reward. Read more on [eigen-portfolios](https:\u002F\u002Fsrome.github.io\u002FEigenvesting-I-Linear-Algebra-Can-Help-You-Choose-Your-Stock-Portfolio\u002F).\n- **stocks_file_path**: File that contains the list of stocks that you want to use to build your portfolio.\n\n### Some Portfolio Building Examples\nHere are a few examples for building different types of portfolios.\n- Both **long and short** portfolios by analyzing last **90 days** data and keeping the **last 30 days** as testing data. This will give us 60 days of portfolio construction data and 30 days of testing.\n```\npython portfolio_manager.py --is_test 1 --future_bars 30 --data_granularity_minutes 3600 --history_to_use 90 --apply_noise_filtering 1 --market_index QQQ --only_long 0 --eigen_portfolio_number 3 --stocks_file_path stocks\u002Fstocks.txt\n```\n- Only **long portfolio** on **60 minute bars** of the last **30 days**. **No future testing**. Compare the results with **SPY** index instead of QQQ.\n```\npython portfolio_manager.py --is_test 0 --future_bars 0 --data_granularity_minutes 60 --history_to_use all --apply_noise_filtering 1 --market_index SPY --only_long 1 --eigen_portfolio_number 3 --stocks_file_path stocks\u002Fstocks.txt\n```\n- **Do not apply noise filtering** on the covariance matrix. Use the **first eigen portfolio** (market portfolio) and compare with SQQQ,\n```\npython portfolio_manager.py --is_test 1 --future_bars 90 --data_granularity_minutes 3600 --history_to_use all --apply_noise_filtering 0 --market_index SQQQ --only_long 1 --eigen_portfolio_number 1 --stocks_file_path stocks\u002Fstocks.txt\n```\n\n## Portfolio Strategies\nFour different portfolio strategies are currently supported by the toolkit.\n1. **Eigen Portfolios**\n\t1. These portfolios are orthogonal and uncorrelated to the market in general thus yielding high reward and alpha. However, since they are uncorrelated to the market, they can also provide great risk. The first eigen portfolio is considered to be a market portfolio which is often ignored. The second one is uncorrelated to the others and provides the highest risk and reward. As we go down the numbering, the risk as well as the reward are reduced.\n2. **Minimum Variance Portfolio (MVP)**\n\t1. MVP tries to minimize the variance of the portfolio. These portfolios are lowest risk and reward.\n3. **Maximum Sharpe Ratio Portfolio (MSR)**\n\t1. MSR solves an optimization problem that tries to maximize the sharpe ratio of the portfolio. It uses past returns during the optimization process which means if past returns are not the same as future returns, the results can vary in future.\n4. **Genetic Algorithm (GA) based Portfolio**\n\t1. This is our own implementation of a GA based portfolio that again tries to maximize the sharpe ratio but in a slightly more robust way. This usually provides more robust portfolios than the others.\n\nWhen you run the command above, our tool will generate portfolios from all these strategies and give them to you. Let us look at some resulting portfolios.\n\n## Resulting Portfolios\nFor the purpose these results, we will use the 9 stocks in the stocks\u002Fstocks.txt file. When we run the above command, we first get the portfolio weights for all four strategies. For testing purposes, the above command used last five years of daily data up till April 29th. The remaining data for this year was used for forward testing i.e the portfolio strategies had no access to it when building the portfolios.\n\n**What if my portfolio needs different stocks?**: All you need to do is change the stocks in the stocks.txt file and run the tool again. Here is the final command again that we run in order to get our portfolios:\n\n```\npython portfolio_manager.py --is_test 1 --future_bars 90 --data_granularity_minutes 3600 --history_to_use all --apply_noise_filtering 1 --market_index QQQ --only_long 1 --eigen_portfolio_number 3 --stocks_file_path stocks\u002Fstocks.txt\n```\n\n### Portfolio Weights\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftradytics_eiten_readme_815c0ff215cf.png\">\n\u003C\u002Fp>\n\nWe can see that the eigen portfolio is giving a large weight to TSLA while the others are dividing their weights more uniformly. An interesting phenomena happening here is the hedging with **SQQQ** that all the strategies have learned automatically. Every tool is assigning some positive weight to SQQQ while also assigning positive weights to other stocks which indicates that the strategies are automatically trying to hedge the portfolios from risk. Obviously this is not perfect, but just the fact that it's happening is fascinating. Let us look at the backtest results on the last five years prior to April 29, 2020.\n\n### Backtest Results\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftradytics_eiten_readme_c2f5153ec628.png\">\n\u003C\u002Fp>\n\nThe backtests look pretty encouraging. The black dotted line is the market index i.e **QQQ**. Other lines are the strategies. Our custom genetic algorithm implementation seems to have the best backtest results because it's an advanced version of other strategies. The eigen portfolio that weighed TSLA the most have the most volatility but its profits are also very high. Finally, as expected, the MVP has the minimum variance and ultimately the least profits. However, since the variance is extremely low, it is a good portfolio for those who want to stay safe. The most interesting part comes next, let us look at the forward or future test results for these portfolios. \n\n### Forward Test Results\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftradytics_eiten_readme_8eb7ade6b9da.png\">\n\u003C\u002Fp>\n\nThese results are from April 29th, 2020 to September 4th, 2020. The eigen portfolio performed the best but it also had a lot of volatility. Moreover, most of those returns are due to TSLA rocketing in the last few months. After that, our GA algorithm worked quite effectively as it beat the market index. Again, as expected, the MVP had the lowest risk and reward and slowly went up in 4-5 months. This shows the effectiveness and power of these algorithmic portfolio optimization strategies where we've developed different portfolios for different kinds of risk and reward profiles.\n\n\n## Conclusion and Discussion\nWe are happy to share this toolkit with the trading community and hope that people will like and contribute to it. As is the case with everything in trading, these strategies are not perfect but they are based on rigorous theory and some great empirical results. Please take care when trading with these strategies and always manage your risk. The above results were not cherry picked but the market has been highly bullish in the last few months which has led to the strong results shown above. We would love for the community to try out different strategies and share them with us.\n\n#### Special Thanks\nSpecial thanks to [Scott Rome's](https:\u002F\u002Fsrome.github.io\u002F) blog. The eigen portfolios and minimum variance portfolio concepts came from his blog posts. The code for filtering eigen values of the covariance matrix was also mostly obtained from one of his posts.\n\n## License\n[![License: GPL v3](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-GPLv3-blue.svg)](https:\u002F\u002Fwww.gnu.org\u002Flicenses\u002Fgpl-3.0)\n\nA product by [Tradytics](https:\u002F\u002Fwww.tradytics.com\u002F)\n\nCopyright (c) 2020-present, Tradytics.com\n","\u003Cp align=\"center\">\n  \u003Cimg width=\"325\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftradytics_eiten_readme_f94a5390f450.png\">\n\u003C\u002Fp>\n\n# Eiten - 面向所有人的算法投资策略\nEiten 是由 [Tradytics](https:\u002F\u002Fwww.tradytics.com\u002F) 开发的开源工具包，实现了多种统计和算法投资策略，例如 **特征组合**、**最小方差组合**、**最大夏普比率组合** 以及基于 **遗传算法** 的组合。它允许您使用自己选择的股票构建能够跑赢市场的投资组合。Eiten 内置的严格测试框架使您可以对您的投资组合充满信心。\n\n如果您希望深入探讨这些工具，并了解我们正在开发的更多工具，请随时加入我们的 [Discord](https:\u002F\u002Fdiscord.gg\u002FQuvE2Z8) 社区，那里还有许多其他实用工具。\n\n### 文件说明\n| 路径 | 描述\n| :--- | :----------\n| eiten | 主文件夹。\n| &boxur;&nbsp; figures | 本 GitHub 仓库中的图表。\n| &boxur;&nbsp; stocks | 存放您用于创建投资组合的股票列表的文件夹。\n| &boxur;&nbsp; strategies | 用 Python 实现的一系列投资策略。\n| backtester.py | 回测模块，可对所有投资组合进行回测和前瞻测试。\n| data_loader.py | 从 Yahoo Finance 加载数据的模块。\n| portfolio_manager.py | 主程序文件，接受多个参数并为您生成多个投资组合。\n| simulator.py | 模拟器，利用历史收益和蒙特卡洛方法模拟投资组合的未来价格。\n| strategy_manager.py | 管理在 'strategies' 文件夹中实现的各种策略。\n\n## 必需的软件包\n您需要安装以下软件包来训练和测试模型：\n- [Scikit-learn](https:\u002F\u002Fscikit-learn.org\u002F)\n- [Numpy](https:\u002F\u002Fnumpy.org\u002F)\n- [Tqdm](https:\u002F\u002Fgithub.com\u002Ftqdm\u002Ftqdm)\n- [Yfinance](https:\u002F\u002Fgithub.com\u002Franaroussi\u002Fyfinance)\n- [Pandas](https:\u002F\u002Fpandas.pydata.org\u002F)\n- [Scipy](https:\u002F\u002Fwww.scipy.org\u002Finstall.html)\n\n您可以使用以下命令一次性安装所有软件包。请注意，该脚本是使用 Python 3 编写的。\n\n```\npip install -r requirements.txt\n```\n\n## 构建您的投资组合\n让我们看看如何使用工具包中的各种策略来构建投资组合。首先，您需要修改 **stocks** 文件夹中的 **stocks.txt** 文件，添加您选择的股票。建议保持股票列表较小，即 **5 到 50 只** 股票即可。我们已经提供了一个包含 AAPL、MSFT、TSLA 等科技股的小型股票列表。现在让我们开始构建投资组合吧。以下是您需要运行的主要命令：\n\n```\npython portfolio_manager.py --is_test 1 --future_bars 90 --data_granularity_minutes 3600 --history_to_use all --apply_noise_filtering 1 --market_index QQQ --only_long 1 --eigen_portfolio_number 3 --stocks_file_path stocks\u002Fstocks.txt\n```\n\n此命令将使用过去 5 年的日线数据（不包括最近 90 天），为您构建多个投资组合。然后，它会使用这 90 天的样本外数据对这些组合进行测试，并显示每个组合的表现。最后，它还会将表现与您选择的市场指数（此处为 QQQ）进行比较。下面我们详细介绍一下各个参数：\n- **is_test**: 该值决定程序是否会保留一部分数据用于未来的测试。当启用时，**future_bars** 的值应大于 5。\n- **future_bars**: 这些是工具在构建投资组合时排除的数据条数，并将在这些排除的数据上对投资组合进行前瞻测试。这也被称为样本外数据。\n- **data_granularity_minutes**: 您希望使用多细粒度的数据来构建投资组合。对于长期投资组合，应使用日线数据；而对于短期投资，则可以使用小时或分钟级别的数据。可能的取值有 **3600、60、30、15、5、1**。其中 3600 表示日线数据。\n- **history_to_use**: 是否使用特定数量的历史数据条数，还是使用从 Yahoo Finance 获取的所有数据。对于分钟级别数据，我们最多只能获取一个月的历史数据；而对于日线数据，则可以获取长达 5 年的历史数据。如果您希望使用所有可用数据，应设置为 **all**；如果只想使用较短的历史数据，可以设置为一个整数值，例如 **100**，这样只会使用最近 100 根柱线来构建投资组合。\n- **apply_noise_filtering**: 此功能使用 [随机矩阵理论](http:\u002F\u002Ffaculty.baruch.cuny.edu\u002Fjgatheral\u002Frandommatrixcovariance2008.pdf) 来过滤掉协方差矩阵中的随机噪声，从而获得更优的投资组合。值为 1 时表示启用，值为 0 时表示禁用。\n- **market_index**: 您希望使用哪个指数来比较您的投资组合。通常应选择 **SPY**，但由于我们分析的是科技股，因此选择了 **QQQ**。\n- **only_long**: 是否仅使用做多的投资组合，还是同时允许做空交易。研究表明，采用算法技术时，仅做多的投资组合往往表现更好。\n- **eigen_portfolio_number**: 使用第几个特征组合。1 到 5 之间的任何值均可。第一个特征组合（1）代表市场组合，其表现应与标的指数（如 SPY 或 QQQ）相似。第二个特征组合与市场正交且不相关，风险和收益都较高。后续的特征组合风险和收益逐渐降低。更多信息请参阅 [特征组合](https:\u002F\u002Fsrome.github.io\u002FEigenvesting-I-Linear-Algebra-Can-Help-You-Choose-Your-Stock-Portfolio\u002F)。\n- **stocks_file_path**: 包含您用于构建投资组合的股票列表的文件路径。\n\n### 投资组合构建示例\n以下是一些构建不同类型投资组合的示例：\n- 同时构建 **多头和空头** 投资组合，分析过去 **90 天** 的数据，并将 **最后 30 天** 作为测试数据。这样我们将有 60 天的组合构建数据和 30 天的测试数据。\n```\npython portfolio_manager.py --is_test 1 --future_bars 30 --data_granularity_minutes 3600 --history_to_use 90 --apply_noise_filtering 1 --market_index QQQ --only_long 0 --eigen_portfolio_number 3 --stocks_file_path stocks\u002Fstocks.txt\n```\n- 仅构建 **多头投资组合**，使用过去 **30 天** 的 **60 分钟线** 数据。**不进行未来测试**。将结果与 **SPY** 指数而非 QQQ 比较。\n```\npython portfolio_manager.py --is_test 0 --future_bars 0 --data_granularity_minutes 60 --history_to_use all --apply_noise_filtering 1 --market_index SPY --only_long 1 --eigen_portfolio_number 3 --stocks_file_path stocks\u002Fstocks.txt\n```\n- **不对协方差矩阵应用噪声过滤**。使用 **第一个特征组合**（市场组合），并与 SQQQ 指数比较。\n```\npython portfolio_manager.py --is_test 1 --future_bars 90 --data_granularity_minutes 3600 --history_to_use all --apply_noise_filtering 0 --market_index SQQQ --only_long 1 --eigen_portfolio_number 1 --stocks_file_path stocks\u002Fstocks.txt\n```\n\n## 投资组合策略\n该工具包目前支持四种不同的投资组合策略。\n1. **特征投资组合**\n\t1. 这些投资组合与市场整体正交且不相关，因此能够带来较高的收益和阿尔法。然而，由于它们与市场不相关，也可能带来较大的风险。第一个特征投资组合被视为市场组合，通常会被忽略。第二个特征投资组合与其他投资组合不相关，提供了最高的风险和收益。随着编号的降低，风险和收益都会相应减少。\n2. **最小方差投资组合（MVP）**\n\t1. MVP旨在最小化投资组合的方差。这些投资组合的风险和收益都是最低的。\n3. **最大夏普比率投资组合（MSR）**\n\t1. MSR通过求解一个优化问题来最大化投资组合的夏普比率。在优化过程中会使用历史收益率，这意味着如果未来收益率与过去不同，结果可能会有所偏差。\n4. **基于遗传算法（GA）的投资组合**\n\t1. 这是我们自己实现的一种基于遗传算法的投资组合策略，同样旨在最大化夏普比率，但方式更为稳健。通常情况下，这种策略能够提供比其他策略更稳健的投资组合。\n\n当你运行上述命令时，我们的工具将根据所有这些策略生成投资组合，并将其呈现给你。接下来我们来看一些生成的投资组合。\n\n## 生成的投资组合\n为了演示这些结果，我们将使用 stocks\u002Fstocks.txt 文件中的9只股票。当我们运行上述命令时，首先会得到四种策略下的投资组合权重。出于测试目的，上述命令使用了截至4月29日的过去五年的日度数据。而今年剩余的数据则用于前瞻性测试，即在构建投资组合时，这些策略无法访问这部分数据。\n\n**如果我的投资组合需要不同的股票怎么办？**：你只需更改 stocks.txt 文件中的股票列表，然后再次运行工具即可。以下是用于获取投资组合的最终命令：\n\n```\npython portfolio_manager.py --is_test 1 --future_bars 90 --data_granularity_minutes 3600 --history_to_use all --apply_noise_filtering 1 --market_index QQQ --only_long 1 --eigen_portfolio_number 3 --stocks_file_path stocks\u002Fstocks.txt\n```\n\n### 投资组合权重\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftradytics_eiten_readme_815c0ff215cf.png\">\n\u003C\u002Fp>\n\n我们可以看到，特征投资组合对TSLA赋予了较大权重，而其他投资组合则较为均匀地分配了权重。这里一个有趣的现象是，所有策略都自动学会了利用**SQQQ**进行对冲。每个策略都为SQQQ分配了一定的正权重，同时也为其他股票分配了正权重，这表明这些策略正在自动尝试对投资组合进行风险对冲。显然，这并不完美，但仅仅是这一现象的发生就令人着迷。接下来让我们看看在2020年4月29日之前的五年内的回测结果。\n\n### 回测结果\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftradytics_eiten_readme_c2f5153ec628.png\">\n\u003C\u002Fp>\n\n回测结果看起来相当令人鼓舞。黑色虚线代表市场指数，即**QQQ**。其他线条则代表不同的策略。我们自定义的遗传算法实现似乎表现最好，因为它是在其他策略基础上进一步优化的版本。而对TSLA权重最大的特征投资组合虽然波动性最高，但其收益也非常可观。最后，正如预期，MVP具有最小的方差，因此最终的收益也最低。不过，由于方差极低，它对于那些希望保持安全的人来说是一个不错的选择。接下来最有趣的部分来了，让我们来看看这些投资组合的前瞻性或未来测试结果。\n\n### 前瞻性测试结果\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftradytics_eiten_readme_8eb7ade6b9da.png\">\n\u003C\u002Fp>\n\n这些结果来自2020年4月29日至9月4日。特征投资组合的表现最佳，但也伴随着较大的波动。此外，大部分收益都归功于TSLA在过去几个月中的大幅上涨。随后，我们的GA算法表现相当出色，成功跑赢了市场指数。再次印证了预期，MVP的风险和收益都是最低的，在4到5个月的时间里缓慢上升。这充分展示了这些算法化投资组合优化策略的有效性和强大之处——我们为不同风险和收益偏好开发了多种投资组合。\n\n\n## 结论与讨论\n我们很高兴能与交易社区分享这个工具包，并希望更多人喜欢并参与其中。如同交易中的所有事物一样，这些策略并非完美，但它们基于严谨的理论和一些出色的实证结果。请在使用这些策略进行交易时务必谨慎，并始终做好风险管理。上述结果并非刻意挑选，而是因为近几个月市场持续走牛，才带来了如此强劲的表现。我们非常期待社区尝试不同的策略，并与我们分享他们的经验。\n\n#### 特别致谢\n特别感谢[Scott Rome](https:\u002F\u002Fsrome.github.io\u002F)的博客。特征投资组合和最小方差投资组合的概念均源自他的博文。用于过滤协方差矩阵特征值的代码也主要来源于他的其中一篇帖子。\n\n## 许可证\n[![许可证：GPL v3](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-GPLv3-blue.svg)](https:\u002F\u002Fwww.gnu.org\u002Flicenses\u002Fgpl-3.0)\n\n由[Tradytics](https:\u002F\u002Fwww.tradytics.com\u002F)出品\n\n版权所有 © 2020–至今，Tradytics.com","# Eiten 快速上手指南\n\nEiten 是一个开源的算法投资策略工具包，由 Tradytics 开发。它实现了多种统计和算法投资策略（如特征投资组合、最小方差组合、最大夏普比率组合及遗传算法组合），帮助用户构建能够跑赢市场的自定义股票投资组合，并提供严谨的回测与向前测试框架。\n\n## 环境准备\n\n### 系统要求\n- **Python 版本**：Python 3.x\n- **操作系统**：Linux \u002F macOS \u002F Windows (需配置 Python 环境)\n\n### 前置依赖\n本项目依赖以下 Python 库：\n- Scikit-learn\n- Numpy\n- Tqdm\n- Yfinance (用于从 Yahoo Finance 加载数据)\n- Pandas\n- Scipy\n\n> **国内加速建议**：由于 `yfinance` 需要访问 Yahoo Finance，国内网络环境下可能不稳定。建议在运行前配置好网络代理，或确保网络通畅。安装依赖时推荐使用国内镜像源以加快下载速度。\n\n## 安装步骤\n\n1. **克隆项目代码**\n   ```bash\n   git clone \u003Crepository_url>\n   cd eiten\n   ```\n   *(注：请将 `\u003Crepository_url>` 替换为实际的 GitHub 仓库地址)*\n\n2. **安装依赖包**\n   推荐使用国内镜像源（如清华源）进行安装：\n   ```bash\n   pip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n   ```\n   或者手动安装核心依赖：\n   ```bash\n   pip install scikit-learn numpy tqdm yfinance pandas scipy -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n   ```\n\n## 基本使用\n\n### 1. 配置股票列表\n在运行策略前，需修改 `stocks\u002Fstocks.txt` 文件，填入你想要构建组合的股票代码（美股代号）。\n- **建议数量**：5 到 50 只股票。\n- **示例内容** (`stocks\u002Fstocks.txt`)：\n  ```text\n  AAPL\n  MSFT\n  TSLA\n  NVDA\n  GOOGL\n  ```\n\n### 2. 运行投资组合构建\n执行以下命令生成投资组合并进行回测与向前测试。该命令将使用过去 5 年的日线数据构建组合，并预留最后 90 天数据进行验证，对比基准为 `QQQ`。\n\n```bash\npython portfolio_manager.py --is_test 1 --future_bars 90 --data_granularity_minutes 3600 --history_to_use all --apply_noise_filtering 1 --market_index QQQ --only_long 1 --eigen_portfolio_number 3 --stocks_file_path stocks\u002Fstocks.txt\n```\n\n### 参数简要说明\n- `--is_test 1`: 启用测试模式，预留部分数据用于向前测试。\n- `--future_bars 90`: 预留最后 90 个时间单位（此处为天）作为测试集。\n- `--data_granularity_minutes 3600`: 数据粒度，3600 代表日线数据（也可设为 60, 30 等表示小时或分钟线）。\n- `--history_to_use all`: 使用所有可用的历史数据。\n- `--apply_noise_filtering 1`: 启用随机矩阵理论去噪，优化协方差矩阵。\n- `--market_index QQQ`: 用于对比的市场指数（科技股常用 QQQ，大盘股可用 SPY）。\n- `--only_long 1`: 仅做多策略（设为 0 可允许做空）。\n- `--eigen_portfolio_number 3`: 选择第 3 个特征投资组合（1 代表市场组合，2 风险收益最高，后续递减）。\n- `--stocks_file_path`: 指定股票列表文件路径。\n\n运行完成后，终端将输出不同策略（Eigen, MVP, MSR, GA）的权重分配、回测结果及向前测试结果图表数据。","一位个人量化投资者希望从科技股池中构建能跑赢纳斯达克（QQQ）的投资组合，但缺乏专业的统计建模与回测能力。\n\n### 没有 eiten 时\n- **策略单一且主观**：只能凭经验手动分配权重或简单均分，无法应用特征投资组合（Eigen Portfolios）或遗传算法等高级统计策略。\n- **回测流程繁琐**：需自行编写代码清洗 Yahoo Finance 数据、划分训练集与测试集，极易出现“未来函数”导致结果虚高。\n- **缺乏严谨验证**：难以进行蒙特卡洛模拟或噪声过滤，无法评估策略在未知市场环境下的稳健性。\n- **对标分析困难**：手动计算夏普比率并与市场指数对比耗时耗力，难以快速迭代优化方案。\n\n### 使用 eiten 后\n- **策略自动落地**：通过一行命令即可调用最小方差、最大夏普比率等多种算法，自动为选定的 5-50 只股票生成最优权重。\n- **内置科学回测**：利用内置的 `backtester.py` 自动隔离样本外数据（如预留 90 天），确保回测结果真实反映实战表现。\n- **深度压力测试**：直接启用噪声过滤和蒙特卡洛模拟器，提前预演极端行情下的组合表现，建立投资信心。\n- **一键绩效对标**：自动生成包含 QQQ 指数对比的性能报告，直观展示各策略是否真正跑赢大盘。\n\neiten 将复杂的机构级量化建模流程简化为可执行的开源工具，让个人投资者也能以低成本构建并验证超越市场的算法投资组合。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftradytics_eiten_815c0ff2.png","tradytics","Tradytics","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Ftradytics_97a523e7.png","Artificial Intelligence driven Trading Tools","Preston, UK",null,"tradytics.com\u002F","https:\u002F\u002Fgithub.com\u002Ftradytics",[81,85],{"name":82,"color":83,"percentage":84},"Python","#3572A5",99.4,{"name":86,"color":87,"percentage":88},"Dockerfile","#384d54",0.6,3189,371,"2026-04-10T14:51:49","GPL-3.0","未说明","不需要 GPU",{"notes":96,"python":97,"dependencies":98},"该工具主要用于统计和算法投资策略（如特征投资组合、最小方差组合等），不涉及深度学习模型，因此无需 GPU 加速。用户需自行修改 stocks\u002Fstocks.txt 文件以指定股票列表（建议 5-50 只）。数据源依赖 Yahoo Finance，分钟级数据仅支持最近一个月，日线数据支持最近五年。","Python 3",[99,100,101,102,103,104],"scikit-learn","numpy","tqdm","yfinance","pandas","scipy",[13,14,15],[107,108,109,110,111,112,72,113,114,115,116,117,118,119],"machine-learning","algorithmic-trading","investment-portfolio","portfolio-optimization","trading-strategies","trading-algorithms","ai","statistics","eigenvalues","free-software","opensource","hedgefund","genetic-algorithm","2026-03-27T02:49:30.150509","2026-04-11T08:01:47.190606",[123,128,133,138,143,148,153],{"id":124,"question_zh":125,"answer_zh":126,"source_url":127},29214,"如何在加拿大市场使用 Eiten？支持实时数据和自动交易吗？","加拿大股票可以使用，在 Yahoo Finance 上代码需添加 `.TO` 后缀（例如 `XQQ.TO`）。若要集成加拿大市场数据，可修改数据管理器文件并接入自定义 API。关于实时数据和自动买卖，该项目主要设计用于投资分析，不易直接转换为自动交易工具，建议使用其他专用工具处理实时执行部分。","https:\u002F\u002Fgithub.com\u002Ftradytics\u002Feiten\u002Fissues\u002F1",{"id":129,"question_zh":130,"answer_zh":131,"source_url":132},29215,"如何禁止做空（即不允许负权重）？","目前 `--only_long` 参数仅在回测和实盘测试阶段将负权重资产视为零权重，并不影响优化过程中的权重计算（优化时仍允许负权重）。若需在优化阶段完全禁止负权重，可在遗传算法中添加约束条件自行实现，或者在优化后将负权重手动转换为零再进行后续模拟。","https:\u002F\u002Fgithub.com\u002Ftradytics\u002Feiten\u002Fissues\u002F4",{"id":134,"question_zh":135,"answer_zh":136,"source_url":137},29216,"运行 portfolio_manager.py 时出现 KeyError: 'historical_prices' 错误怎么办？","该问题通常由代码版本更新导致的数据加载逻辑变化引起。维护者已确认修复，请拉取最新代码后重试。如果问题依旧，请检查是否使用了正确的命令行参数组合，并确保数据文件路径正确。","https:\u002F\u002Fgithub.com\u002Ftradytics\u002Feiten\u002Fissues\u002F11",{"id":139,"question_zh":140,"answer_zh":141,"source_url":142},29217,"在 Google Colab 或 Jupyter Notebook 中运行时图表不显示或保存为空白图片怎么办？","不要使用 `!python` 命令运行脚本。请改用 Jupyter 的 `%run` 魔法命令，例如：`%run portfolio_manager.py --is_test 1 ...`。这样 matplotlib 图表才能正确渲染并显示在输出单元格中。","https:\u002F\u002Fgithub.com\u002Ftradytics\u002Feiten\u002Fissues\u002F27",{"id":144,"question_zh":145,"answer_zh":146,"source_url":147},29218,"加载欧洲股票（如巴黎交易所代码 ICNYB.PA）时报错或被忽略怎么办？","尝试将市场基准指数（market_index）从默认的 SPY 更改为对应的巴黎本地指数（如 CAC40 相关代码），这有助于解决因基准不匹配导致的 ticker 加载问题。","https:\u002F\u002Fgithub.com\u002Ftradytics\u002Feiten\u002Fissues\u002F17",{"id":149,"question_zh":150,"answer_zh":151,"source_url":152},29219,"仅做多（long only）模式下投资组合权重总和不为 1（通常在 2.5 到 4 之间）是什么原因？","这是一个已知问题，代码中缺少对仅做多模式下的权重归一化处理。用户可以自行添加归一化计算步骤（将权重除以权重总和）来修正此问题，或者等待社区提交修复补丁。","https:\u002F\u002Fgithub.com\u002Ftradytics\u002Feiten\u002Fissues\u002F18",{"id":154,"question_zh":155,"answer_zh":156,"source_url":157},29220,"随机矩阵理论（Random Matrix Theory）去噪后协方差矩阵似乎消失了，这是实现错误还是正常现象？","该现象可能是由于去噪方法过于激进或数据特性导致。建议用户在不同时间段和数据集上进行测试验证。如果确认是普遍问题，欢迎提交 Pull Request 提供修复方案或调整去噪阈值参数。","https:\u002F\u002Fgithub.com\u002Ftradytics\u002Feiten\u002Fissues\u002F20",[]]