[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-enzoampil--fastquant":3,"tool-enzoampil--fastquant":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 真正成长为懂上",151918,2,"2026-04-12T11:33:05",[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":76,"owner_location":77,"owner_email":78,"owner_twitter":79,"owner_website":76,"owner_url":80,"languages":81,"stars":97,"forks":98,"last_commit_at":99,"license":100,"difficulty_score":101,"env_os":102,"env_gpu":103,"env_ram":104,"env_deps":105,"category_tags":112,"github_topics":114,"view_count":32,"oss_zip_url":124,"oss_zip_packed_at":124,"status":17,"created_at":125,"updated_at":126,"faqs":127,"releases":161},6957,"enzoampil\u002Ffastquant","fastquant","fastquant — Backtest and optimize your ML trading strategies with only 3 lines of code!","fastquant 是一款专为量化交易设计的 Python 开源库，旨在让投资策略的回测与优化变得前所未有的简单。它核心解决了传统金融量化分析门槛高、代码实现复杂的问题，让用户仅需三行代码即可完成从数据获取到策略验证的全过程。\n\n该工具非常适合希望尝试数据驱动投资的开发者、金融研究人员以及量化交易初学者使用。无论是想要快速验证想法的程序员，还是缺乏深厚编程背景但渴望探索量化领域的投资者，都能通过 fastquant 轻松上手。\n\nfastquant 的技术亮点在于其高度集成的功能模块：它不仅支持直接拉取雅虎财经（Yahoo Finance）的历史股票数据和币安（Binance）的加密货币行情，还内置了多种经典交易策略模板（如移动平均线交叉策略）。更强大的是，它支持自动化网格搜索，帮助用户自动测试多组参数组合，从而快速找到最优策略配置。此外，项目团队还推出了无代码平台 Hawksight，为不愿编写代码的用户提供了另一种便捷选择。通过简化繁琐的数据处理和建模流程，fastquant 真正致力于将专业的量化分析能力带给每一位感兴趣的探索者。","# fastquant :nerd_face:\n[![Build Status](https:\u002F\u002Ftravis-ci.com\u002Fenzoampil\u002Ffastquant.svg?branch=master)](https:\u002F\u002Ftravis-ci.com\u002Fenzoampil\u002Ffastquant)\n[![Code style: black](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fcode%20style-black-000000.svg)](https:\u002F\u002Fgithub.com\u002Fambv\u002Fblack)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue.svg)](https:\u002F\u002Fraw.githubusercontent.com\u002Fenzoampil\u002Ffastquant\u002Fmaster\u002FLICENSE)\n[![Downloads](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_575ab4fc5da8.png)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Ffastquant)\n## Bringing backtesting to the mainstream\n\n**fastquant** allows you to easily backtest investment strategies with as few as 3 lines of python code. Its goal is to promote data driven investments by making quantitative analysis in finance accessible to everyone.\n\nTo do this type of analysis without coding, you can also try out [Hawksight](https:\u002F\u002Fhawksight.co\u002F), which was just recently launched! :smile:\n\nIf you want to interact with us directly, you can also reach us on the [Hawksight discord](https:\u002F\u002Fdiscord.gg\u002FBHMCw2C6VP). Feel free to ask about fastquant in the #feedback-suggestions and #bug-report channels.\n\n\n## Features\n1. Easily access historical stock data\n2. Backtest and optimize trading strategies with only 3 lines of code\n\n\u003Csup>`*` - Both Yahoo Finance and Philippine stock data data are accessible straight from fastquant\u003Csup>\n\nCheck out our blog posts in the fastquant [website](https:\u002F\u002Fenzoampil.github.io\u002Ffastquant-blog\u002F) and this intro [article](https:\u002F\u002Ftowardsdatascience.com\u002Fbacktest-your-trading-strategy-with-only-3-lines-of-python-3859b4a4ab44?source=friends_link&sk=ec647b6bb43fe322013248fd1d473015) on Medium!\n\n## Installation\n\n### Python\n\n```\npip install fastquant\nor\npython -m pip install fastquant\n```\n\n## Get stock data\nAll symbols from [Yahoo Finance](https:\u002F\u002Ffinance.yahoo.com\u002F) and Philippine Stock Exchange ([PSE](https:\u002F\u002Fwww.pesobility.com\u002Fstock)) are accessible via `get_stock_data`.\n\n### Python\n\n```\nfrom fastquant import get_stock_data\ndf = get_stock_data(\"JFC\", \"2018-01-01\", \"2019-01-01\")\nprint(df.head())\n\n#           dt  close\n#   2019-01-01  293.0\n#   2019-01-02  292.0\n#   2019-01-03  309.0\n#   2019-01-06  323.0\n#   2019-01-07  321.0\n```\n\n## Get crypto data\nThe data is pulled from Binance, and all the available tickers are found [here](https:\u002F\u002Fcoinmarketcap.com\u002Fexchanges\u002Fbinance\u002F).\n\n### Python\n\n```\nfrom fastquant import get_crypto_data\ncrypto = get_crypto_data(\"BTC\u002FUSDT\", \"2018-12-01\", \"2019-12-31\")\ncrypto.head()\n\n#             open    high     low     close    volume\n# dt                                                          \n# 2018-12-01  4041.27  4299.99  3963.01  4190.02  44840.073481\n# 2018-12-02  4190.98  4312.99  4103.04  4161.01  38912.154790\n# 2018-12-03  4160.55  4179.00  3827.00  3884.01  49094.369163\n# 2018-12-04  3884.76  4085.00  3781.00  3951.64  48489.551613\n# 2018-12-05  3950.98  3970.00  3745.00  3769.84  44004.799448\n```\n\n## Backtest trading strategies\n\n### Simple Moving Average Crossover (15 day MA vs 40 day MA)\nDaily Jollibee prices from 2018-01-01 to 2019-01-01\n```\nfrom fastquant import backtest\nbacktest('smac', df, fast_period=15, slow_period=40)\n\n# Starting Portfolio Value: 100000.00\n# Final Portfolio Value: 102272.90\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_ff8cba58399f.png)\n\n## Want to do this without coding at all?\n\nIf you want to make this kind of analysis even more simple without having to code at all (or want to avoid the pain of doing all of the setup required), you can signup for free and try out [Hawksight](https:\u002F\u002Fhawksight.co\u002F) - this new no-code tool I’m building to democratize data driven investments.\n\nHoping to make these kinds of powerful analyses accessible to more people!\n\n## Optimize trading strategies with automated grid search\n\nfastquant allows you to automatically measure the performance of your trading strategy on multiple combinations of parameters. All you need to do is to input the values as iterators (like as a `list` or `range`).\n\n### Simple Moving Average Crossover (15 to 30 day MA vs 40 to 55 day MA)\nDaily Jollibee prices from 2018-01-01 to 2019-01-01\n\n```\nfrom fastquant import backtest\nres = backtest(\"smac\", df, fast_period=range(15, 30, 3), slow_period=range(40, 55, 3), verbose=False)\n\n# Optimal parameters: {'init_cash': 100000, 'buy_prop': 1, 'sell_prop': 1, 'execution_type': 'close', 'fast_period': 15, 'slow_period': 40}\n# Optimal metrics: {'rtot': 0.022, 'ravg': 9.25e-05, 'rnorm': 0.024, 'rnorm100': 2.36, 'sharperatio': None, 'pnl': 2272.9, 'final_value': 102272.90}\n\nprint(res[['fast_period', 'slow_period', 'final_value']].head())\n\n#\tfast_period\tslow_period\tfinal_value\n#0\t15\t        40\t        102272.90\n#1\t21\t        40\t         98847.00\n#2\t21\t        52\t         98796.09\n#3\t24\t        46\t         98008.79\n#4\t15\t        46\t         97452.92\n\n```\n\n## Library of trading strategies\n\n| Strategy | Alias | Parameters |\n| --- | --- | --- |\n| Relative Strength Index (RSI) | rsi | `rsi_period`, `rsi_upper`,  `rsi_lower` |\n| Simple moving average crossover (SMAC) | smac | `fast_period`, `slow_period` |\n| Exponential moving average crossover (EMAC) | emac | `fast_period`, `slow_period` |\n| Moving Average Convergence Divergence (MACD) | macd | `fast_perod`, `slow_upper`, `signal_period`, `sma_period`, `dir_period` |\n| Bollinger Bands | bbands | `period`, `devfactor` |\n| Buy and Hold | buynhold | `N\u002FA` |\n| Sentiment Strategy | sentiment | `keyword` , `page_nums`, `senti` |\n| Custom Prediction Strategy | custom | `upper_limit`, `lower_limit`, `custom_column` |\n| Custom Ternary Strategy | ternary | `buy_int`, `sell_int`, `custom_column` |\n\n### Relative Strength Index (RSI) Strategy\n```\nbacktest('rsi', df, rsi_period=14, rsi_upper=70, rsi_lower=30)\n\n# Starting Portfolio Value: 100000.00\n# Final Portfolio Value: 132967.87\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_cda50c5bb268.png)\n\n### Simple moving average crossover (SMAC) Strategy\n```\nbacktest('smac', df, fast_period=10, slow_period=30)\n\n# Starting Portfolio Value: 100000.00\n# Final Portfolio Value: 95902.74\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_4600732c6ec9.png)\n\n### Exponential moving average crossover (EMAC) Strategy\n```\nbacktest('emac', df, fast_period=10, slow_period=30)\n\n# Starting Portfolio Value: 100000.00\n# Final Portfolio Value: 90976.00\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_7ce4d66e2bba.png)\n\n### Moving Average Convergence Divergence (MACD) Strategy\n```\nbacktest('macd', df, fast_period=12, slow_period=26, signal_period=9, sma_period=30, dir_period=10)\n\n# Starting Portfolio Value: 100000.00\n# Final Portfolio Value: 96229.58\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_a7968a92ae1b.png)\n\n### Bollinger Bands Strategy\n```\nbacktest('bbands', df, period=20, devfactor=2.0)\n\n# Starting Portfolio Value: 100000.00\n# Final Portfolio Value: 97060.30\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_a175c90dce58.png)\n\n### News Sentiment Strategy\nUse Tesla (TSLA) stock from yahoo finance and news articles from [Business Times](https:\u002F\u002Fwww.businesstimes.com.sg\u002F)\n```\nfrom fastquant import get_yahoo_data, get_bt_news_sentiment\ndata = get_yahoo_data(\"TSLA\", \"2020-01-01\", \"2020-07-04\")\nsentiments = get_bt_news_sentiment(keyword=\"tesla\", page_nums=3)\nbacktest(\"sentiment\", data, sentiments=sentiments, senti=0.2)\n\n# Starting Portfolio Value: 100000.00\n# Final Portfolio Value: 313198.37\n# Note: Unfortunately, you can't recreate this scenario due to inconsistencies in the dates and sentiments that is scraped by get_bt_news_sentiment. In order to have a quickstart with News Sentiment Strategy you need to make the dates consistent with the sentiments that you are scraping.\n\nfrom fastquant import get_yahoo_data, get_bt_news_sentiment\nfrom datetime import datetime, timedelta\n\n# we get the current date and delta time of 30 days\ncurrent_date = datetime.now().strftime(\"%Y-%m-%d\")\ndelta_date = (datetime.now() - timedelta(30)).strftime(\"%Y-%m-%d\")\ndata = get_yahoo_data(\"TSLA\", delta_date, current_date)\nsentiments = get_bt_news_sentiment(keyword=\"tesla\", page_nums=3)\nbacktest(\"sentiment\", data, sentiments=sentiments, senti=0.2)\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_f75ff95e0d13.png)\n\n### Multi Strategy\n\nMultiple registered strategies can be utilized together in an OR fashion, where buy or sell signals are applied when at least one of the strategies trigger them.\n\n```\ndf = get_stock_data(\"JFC\", \"2018-01-01\", \"2019-01-01\")\n\n# Utilize single set of parameters\nstrats = { \n    \"smac\": {\"fast_period\": 35, \"slow_period\": 50}, \n    \"rsi\": {\"rsi_lower\": 30, \"rsi_upper\": 70} \n} \nres = backtest(\"multi\", df, strats=strats)\nres.shape\n# (1, 16)\n\n\n# Utilize auto grid search\nstrats_opt = { \n    \"smac\": {\"fast_period\": 35, \"slow_period\": [40, 50]}, \n    \"rsi\": {\"rsi_lower\": [15, 30], \"rsi_upper\": 70} \n} \n\nres_opt = backtest(\"multi\", df, strats=strats_opt)\nres_opt.shape\n# (4, 16)\n```\n\n### Custom Strategy for Backtesting Machine Learning & Statistics Based Predictions\n\nThis powerful strategy allows you to backtest your own trading strategies using any type of model w\u002F as few as 3 lines of code after the forecast!\n\nPredictions based on any model can be used as a custom indicator to be backtested using fastquant. You just need to add a `custom` column in the input dataframe, and set values for `upper_limit` and `lower_limit`.\n\nThe strategy is structured similar to `RSIStrategy` where you can set an `upper_limit`, above which the asset is sold (considered \"overbought\"), and a `lower_limit`, below which the asset is bought (considered \"underbought). `upper_limit` is set to 95 by default, while `lower_limit` is set to 5 by default.\n\nIn the example below, we show how to use the custom strategy to backtest a custom indicator based on out-of-sample time series forecasts. The forecasts were generated using Facebook's [Prophet](https:\u002F\u002Fgithub.com\u002Ffacebook\u002Fprophet) package on Bitcoin prices.\n\n```\nfrom fastquant import get_crypto_data, backtest\nfrom fbprophet import Prophet\nimport pandas as pd\nfrom matplotlib import pyplot as plt\n\n# Pull crypto data\ndf = get_crypto_data(\"BTC\u002FUSDT\", \"2019-01-01\", \"2020-05-31\")\n\n# Fit model on closing prices\nts = df.reset_index()[[\"dt\", \"close\"]]\nts.columns = ['ds', 'y']\nm = Prophet(daily_seasonality=True, yearly_seasonality=True).fit(ts)\nforecast = m.make_future_dataframe(periods=0, freq='D')\n\n# Predict and plot\npred = m.predict(forecast)\nfig1 = m.plot(pred)\nplt.title('BTC\u002FUSDT: Forecasted Daily Closing Price', fontsize=25)\n```\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_45396d530f30.png)\n\n```\n# Convert predictions to expected 1 day returns\nexpected_1day_return = pred.set_index(\"ds\").yhat.pct_change().shift(-1).multiply(100)\n\n# Backtest the predictions, given that we buy bitcoin when the predicted next day return is > +1.5%, and sell when it's \u003C -1.5%.\ndf[\"custom\"] = expected_1day_return.multiply(-1)\nbacktest(\"custom\", df.dropna(),upper_limit=1.5, lower_limit=-1.5)\n```\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_a2640d906da4.png)\n\nSee more examples [here](https:\u002F\u002Fnbviewer.jupyter.org\u002Fgithub\u002Fenzoampil\u002Ffastquant\u002Ftree\u002Fmaster\u002Fexamples\u002F).\n\n## fastquant API\nView full list of fastquan API [here](API.md)\n\n## Be part of the growing fastquant community\n\nWant to discuss more about fastquant with other users, and our team of developers?\n\nYou can reach us on the [Hawksight discord](https:\u002F\u002Fdiscord.gg\u002FBHMCw2C6VP). Feel free to ask about fastquant in the #feedback-suggestions and #bug-report channels.\n\n## Run fastquant in a Docker Container\n\n```\n# Build the image\ndocker build -t myimage .\n\n# Run the container\ndocker run -t -d -p 5000:5000 myimage\n\n# Get the container id\ndocker ps\n\n# SSH into the fastquant container\ndocker exec -it \u003CCONTAINER_ID> \u002Fbin\u002Fbash\n\n# Run python and use fastquant\npython\n\n>>> from fastquant import get_stock_data\n>>> df = get_stock_data(\"TSLA\", \"2019-01-01\", \"2020-01-01\")\n>>> df.head()\n```\n","# fastquant :nerd_face:\n[![构建状态](https:\u002F\u002Ftravis-ci.com\u002Fenzoampil\u002Ffastquant.svg?branch=master)](https:\u002F\u002Ftravis-ci.com\u002Fenzoampil\u002Ffastquant)\n[![代码风格：black](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fcode%20style-black-000000.svg)](https:\u002F\u002Fgithub.com\u002Fambv\u002Fblack)\n[![许可证：MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue.svg)](https:\u002F\u002Fraw.githubusercontent.com\u002Fenzoampil\u002Ffastquant\u002Fmaster\u002FLICENSE)\n[![下载量](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_575ab4fc5da8.png)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Ffastquant)\n## 让回测回归主流\n\n**fastquant** 使您只需短短 3 行 Python 代码即可轻松地对投资策略进行回测。它的目标是通过让金融量化分析触手可及，从而推动数据驱动型投资的发展。\n\n如果您不想编写代码就能进行此类分析，也可以试试最近刚刚推出的 [Hawksight](https:\u002F\u002Fhawksight.co\u002F)！:smile:\n\n如果您想直接与我们交流，也可以在 [Hawksight 的 Discord](https:\u002F\u002Fdiscord.gg\u002FBHMCw2C6VP) 上找到我们。欢迎在 #feedback-suggestions 和 #bug-report 频道中提问关于 fastquant 的问题。\n\n\n## 功能\n1. 轻松获取历史股票数据\n2. 仅需 3 行代码即可回测和优化交易策略\n\n\u003Csup>`*` - Yahoo Finance 和菲律宾股市的数据均可直接从 fastquant 获取\u003C\u002Fsup>\n\n请查看 fastquant [网站](https:\u002F\u002Fenzoampil.github.io\u002Ffastquant-blog\u002F)上的博客文章，以及这篇 Medium 上的介绍性 [文章](https:\u002F\u002Ftowardsdatascience.com\u002Fbacktest-your-trading-strategy-with-only-3-lines-of-python-3859b4a4ab44?source=friends_link&sk=ec647b6bb43fe322013248fd1d473015)！\n\n## 安装\n\n### Python\n\n```\npip install fastquant\n或\npython -m pip install fastquant\n```\n\n## 获取股票数据\n可通过 `get_stock_data` 访问来自 [Yahoo Finance](https:\u002F\u002Ffinance.yahoo.com\u002F) 和菲律宾证券交易所 ([PSE](https:\u002F\u002Fwww.pesobility.com\u002Fstock)) 的所有股票代码。\n\n### Python\n\n```\nfrom fastquant import get_stock_data\ndf = get_stock_data(\"JFC\", \"2018-01-01\", \"2019-01-01\")\nprint(df.head())\n\n#           dt  close\n#   2019-01-01  293.0\n#   2019-01-02  292.0\n#   2019-01-03  309.0\n#   2019-01-06  323.0\n#   2019-01-07  321.0\n```\n\n## 获取加密货币数据\n数据来源于 Binance，所有可用的交易对都可以在 [这里](https:\u002F\u002Fcoinmarketcap.com\u002Fexchanges\u002Fbinance\u002F)找到。\n\n### Python\n\n```\nfrom fastquant import get_crypto_data\ncrypto = get_crypto_data(\"BTC\u002FUSDT\", \"2018-12-01\", \"2019-12-31\")\ncrypto.head()\n\n#             open    high     low     close    volume\n# dt                                                          \n# 2018-12-01  4041.27  4299.99  3963.01  4190.02  44840.073481\n# 2018-12-02  4190.98  4312.99  4103.04  4161.01  38912.154790\n# 2018-12-03  4160.55  4179.00  3827.00  3884.01  49094.369163\n# 2018-12-04  3884.76  4085.00  3781.00  3951.64  48489.551613\n# 2018-12-05  3950.98  3970.00  3745.00  3769.84  44004.799448\n```\n\n## 回测交易策略\n\n### 简单移动平均线交叉策略（15 日均线 vs 40 日均线）\n2018 年 1 月 1 日至 2019 年 1 月 1 日每日 Jollibee 的股价\n```\nfrom fastquant import backtest\nbacktest('smac', df, fast_period=15, slow_period=40)\n\n# 初始投资组合价值：100000.00\n# 最终投资组合价值：102272.90\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_ff8cba58399f.png)\n\n## 想完全不用编程来做这件事吗？\n\n如果您希望在完全无需编码的情况下进一步简化这类分析（或者想避免繁琐的设置过程），可以免费注册并试用 [Hawksight](https:\u002F\u002Fhawksight.co\u002F)——这是我正在开发的一款新型无代码工具，旨在让数据驱动的投资更加普及。\n\n希望能让更多人享受到这种强大的分析能力！\n\n## 使用自动化网格搜索优化交易策略\n\nfastquant 允许您自动评估交易策略在多种参数组合下的表现。您只需将参数值以迭代器的形式输入即可（例如列表或范围）。\n\n### 简单移动平均线交叉策略（15 至 30 日均线 vs 40 至 55 日均线）\n2018 年 1 月 1 日至 2019 年 1 月 1 日每日 Jollibee 的股价\n\n```\nfrom fastquant import backtest\nres = backtest(\"smac\", df, fast_period=range(15, 30, 3), slow_period=range(40, 55, 3), verbose=False)\n\n# 最优参数：{'init_cash': 100000, 'buy_prop': 1, 'sell_prop': 1, 'execution_type': 'close', 'fast_period': 15, 'slow_period': 40}\n# 最优指标：{'rtot': 0.022, 'ravg': 9.25e-05, 'rnorm': 0.024, 'rnorm100': 2.36, 'sharperatio': None, 'pnl': 2272.9, 'final_value': 102272.90}\n\nprint(res[['fast_period', 'slow_period', 'final_value']].head())\n\n#\tfast_period\tslow_period\tfinal_value\n#0\t15\t        40\t        102272.90\n#1\t21\t        40\t         98847.00\n#2\t21\t        52\t         98796.09\n#3\t24\t        46\t         98008.79\n#4\t15\t        46\t         97452.92\n\n```\n\n## 交易策略库\n\n| 策略 | 别名 | 参数 |\n| --- | --- | --- |\n| 相对强弱指数 (RSI) | rsi | `rsi_period`, `rsi_upper`,  `rsi_lower` |\n| 简单移动平均线交叉 (SMAC) | smac | `fast_period`, `slow_period` |\n| 指数移动平均线交叉 (EMAC) | emac | `fast_period`, `slow_period` |\n| 移动平均线收敛发散 (MACD) | macd | `fast_perod`, `slow_upper`, `signal_period`, `sma_period`, `dir_period` |\n| 布林带 | bbands | `period`, `devfactor` |\n| 买入并持有 | buynhold | `无` |\n| 情感策略 | sentiment | `keyword` , `page_nums`, `senti` |\n| 自定义预测策略 | custom | `upper_limit`, `lower_limit`, `custom_column` |\n| 自定义三元策略 | ternary | `buy_int`, `sell_int`, `custom_column` |\n\n### 相对强弱指数 (RSI) 策略\n```\nbacktest('rsi', df, rsi_period=14, rsi_upper=70, rsi_lower=30)\n\n# 初始投资组合价值：100000.00\n# 最终投资组合价值：132967.87\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_cda50c5bb268.png)\n\n### 简单移动平均线交叉 (SMAC) 策略\n```\nbacktest('smac', df, fast_period=10, slow_period=30)\n\n# 初始投资组合价值：100000.00\n# 最终投资组合价值：95902.74\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_4600732c6ec9.png)\n\n### 指数移动平均线交叉 (EMAC) 策略\n```\nbacktest('emac', df, fast_period=10, slow_period=30)\n\n# 初始投资组合价值：100000.00\n# 最终投资组合价值：90976.00\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_7ce4d66e2bba.png)\n\n### 移动平均线收敛发散 (MACD) 策略\n```\nbacktest('macd', df, fast_period=12, slow_period=26, signal_period=9, sma_period=30, dir_period=10)\n\n# 初始投资组合价值：100000.00\n# 最终投资组合价值：96229.58\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_a7968a92ae1b.png)\n\n### 布林带策略\n```\nbacktest('bbands', df, period=20, devfactor=2.0)\n\n# 初始投资组合价值：100000.00\n# 最终投资组合价值：97060.30\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_a175c90dce58.png)\n\n### 新闻情绪策略\n使用雅虎财经的特斯拉（TSLA）股票数据和[商业时报](https:\u002F\u002Fwww.businesstimes.com.sg\u002F)的新闻文章：\n```\nfrom fastquant import get_yahoo_data, get_bt_news_sentiment\ndata = get_yahoo_data(\"TSLA\", \"2020-01-01\", \"2020-07-04\")\nsentiments = get_bt_news_sentiment(keyword=\"tesla\", page_nums=3)\nbacktest(\"sentiment\", data, sentiments=sentiments, senti=0.2)\n\n# 初始投资组合价值：100000.00\n# 最终投资组合价值：313198.37\n# 注意：遗憾的是，由于get_bt_news_sentiment抓取的日期和情绪存在不一致，您无法重现此场景。为了快速开始使用新闻情绪策略，您需要确保抓取的情绪与对应的日期一致。\n\nfrom fastquant import get_yahoo_data, get_bt_news_sentiment\nfrom datetime import datetime, timedelta\n\n# 获取当前日期及30天前的日期\ncurrent_date = datetime.now().strftime(\"%Y-%m-%d\")\ndelta_date = (datetime.now() - timedelta(30)).strftime(\"%Y-%m-%d\")\ndata = get_yahoo_data(\"TSLA\", delta_date, current_date)\nsentiments = get_bt_news_sentiment(keyword=\"tesla\", page_nums=3)\nbacktest(\"sentiment\", data, sentiments=sentiments, senti=0.2)\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_f75ff95e0d13.png)\n\n### 多策略\n可以将多个已注册的策略以“或”的方式同时使用，当至少有一个策略发出买入或卖出信号时，就会执行相应的交易。\n```\ndf = get_stock_data(\"JFC\", \"2018-01-01\", \"2019-01-01\")\n\n# 使用单一参数集\nstrats = { \n    \"smac\": {\"fast_period\": 35, \"slow_period\": 50}, \n    \"rsi\": {\"rsi_lower\": 30, \"rsi_upper\": 70} \n} \nres = backtest(\"multi\", df, strats=strats)\nres.shape\n# (1, 16)\n\n\n# 使用自动网格搜索\nstrats_opt = { \n    \"smac\": {\"fast_period\": 35, \"slow_period\": [40, 50]}, \n    \"rsi\": {\"rsi_lower\": [15, 30], \"rsi_upper\": 70} \n} \n\nres_opt = backtest(\"multi\", df, strats=strats_opt)\nres_opt.shape\n# (4, 16)\n```\n\n### 用于回测机器学习和统计模型预测的自定义策略\n这一强大的策略允许您使用任何类型的模型来回测自己的交易策略，只需在预测结果之后添加短短三行代码即可！\n\n基于任何模型的预测都可以作为自定义指标，利用fastquant进行回测。您只需在输入数据框中添加一个`custom`列，并设置`upper_limit`和`lower_limit`的值。\n\n该策略的结构类似于`RSIStrategy`，您可以设置一个`upper_limit`，当指标高于该值时卖出资产（视为“超买”），以及一个`lower_limit`，当指标低于该值时买入资产（视为“超卖”）。默认情况下，`upper_limit`设为95，而`lower_limit`设为5。\n\n在下面的例子中，我们展示了如何使用自定义策略来回测基于样本外时间序列预测的自定义指标。这些预测是使用Facebook的[Prophet](https:\u002F\u002Fgithub.com\u002Ffacebook\u002Fprophet)包对比特币价格生成的。\n```\nfrom fastquant import get_crypto_data, backtest\nfrom fbprophet import Prophet\nimport pandas as pd\nfrom matplotlib import pyplot as plt\n\n# 获取加密货币数据\ndf = get_crypto_data(\"BTC\u002FUSDT\", \"2019-01-01\", \"2020-05-31\")\n\n# 在收盘价上拟合模型\nts = df.reset_index()[[\"dt\", \"close\"]]\nts.columns = ['ds', 'y']\nm = Prophet(daily_seasonality=True, yearly_seasonality=True).fit(ts)\nforecast = m.make_future_dataframe(periods=0, freq='D')\n\n# 预测并绘制\npred = m.predict(forecast)\nfig1 = m.plot(pred)\nplt.title('BTC\u002FUSDT: 预测的每日收盘价', fontsize=25)\n```\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_45396d530f30.png)\n\n```\n# 将预测转换为预期的1日收益率\nexpected_1day_return = pred.set_index(\"ds\").yhat.pct_change().shift(-1).multiply(100)\n\n# 回测这些预测：当预测的次日收益率大于+1.5%时买入比特币，小于-1.5%时卖出。\ndf[\"custom\"] = expected_1day_return.multiply(-1)\nbacktest(\"custom\", df.dropna(),upper_limit=1.5, lower_limit=-1.5)\n```\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_readme_a2640d906da4.png)\n\n更多示例请参见[这里](https:\u002F\u002Fnbviewer.jupyter.org\u002Fgithub\u002Fenzoampil\u002Ffastquant\u002Ftree\u002Fmaster\u002Fexamples\u002F)。\n\n## fastquant API\n完整fastquant API列表请查看[这里](API.md)。\n\n## 加入不断壮大的fastquant社区\n想与其他用户及我们的开发团队讨论更多关于fastquant的内容吗？\n\n您可以通过[Hawksight Discord](https:\u002F\u002Fdiscord.gg\u002FBHMCw2C6VP)联系我们。欢迎在#feedback-suggestions和#bug-report频道中提问有关fastquant的问题。\n\n## 在Docker容器中运行fastquant\n```\n# 构建镜像\ndocker build -t myimage .\n\n# 运行容器\ndocker run -t -d -p 5000:5000 myimage\n\n# 获取容器ID\ndocker ps\n\n# SSH进入fastquant容器\ndocker exec -it \u003CCONTAINER_ID> \u002Fbin\u002Fbash\n\n# 运行Python并使用fastquant\npython\n\n>>> from fastquant import get_stock_data\n>>> df = get_stock_data(\"TSLA\", \"2019-01-01\", \"2020-01-01\")\n>>> df.head()\n```","# fastquant 快速上手指南\n\nfastquant 是一个旨在让量化投资分析大众化的 Python 库。它允许你仅用 3 行代码即可轻松获取历史数据并回测投资策略。\n\n## 环境准备\n\n*   **操作系统**：支持 Windows、macOS 和 Linux。\n*   **Python 版本**：建议安装 Python 3.6 或更高版本。\n*   **前置依赖**：确保已安装 `pip` 包管理工具。\n    *   *注：原文未提供特定的中国镜像源配置，若下载缓慢，建议在安装命令中配合使用国内镜像（如 `-i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple`）。*\n\n## 安装步骤\n\n使用 pip 进行安装：\n\n```bash\npip install fastquant\n```\n\n或者：\n\n```bash\npython -m pip install fastquant\n```\n\n## 基本使用\n\nfastquant 的核心功能包括获取数据和回测策略。以下是两个最基础的使用示例。\n\n### 1. 获取股票数据\n\n支持直接获取 Yahoo Finance 和菲律宾证券交易所（PSE）的数据。以下示例展示如何获取 Jollibee (JFC) 的股票数据：\n\n```python\nfrom fastquant import get_stock_data\n\n# 获取 2018-01-01 到 2019-01-01 的 JFC 股票数据\ndf = get_stock_data(\"JFC\", \"2018-01-01\", \"2019-01-01\")\nprint(df.head())\n```\n\n### 2. 回测交易策略\n\n只需一行代码即可对简单移动平均交叉策略（SMAC）进行回测。以下示例使用上述获取的数据，设置快线周期为 15 天，慢线周期为 40 天：\n\n```python\nfrom fastquant import backtest\n\n# 执行回测\nbacktest('smac', df, fast_period=15, slow_period=40)\n```\n\n**输出示例：**\n```text\nStarting Portfolio Value: 100000.00\nFinal Portfolio Value: 102272.90\n```\n\n### 进阶：自动参数优化\n\n你还可以使用网格搜索自动寻找最优参数组合。只需将参数设置为列表或范围（`range`）：\n\n```python\nfrom fastquant import backtest\n\n# 在指定范围内自动搜索最优的快线和慢线周期\nres = backtest(\"smac\", df, fast_period=range(15, 30, 3), slow_period=range(40, 55, 3), verbose=False)\n\n# 查看结果\nprint(res[['fast_period', 'slow_period', 'final_value']].head())\n```","一位个人量化交易者想要验证“双均线交叉策略”在菲律宾股市（如 Jollibee 食品公司）的历史表现，以决定是否投入真实资金。\n\n### 没有 fastquant 时\n- **数据获取繁琐**：需要手动编写复杂的爬虫脚本或去多个金融网站下载 CSV 文件，还要处理日期格式不统一和缺失值问题。\n- **回测代码冗长**：必须从零搭建回测框架，编写几十行甚至上百行代码来计算移动平均线、生成交叉信号并模拟买卖逻辑。\n- **参数优化困难**：若想测试不同周期组合（如 15 日 vs 40 日，或 20 日 vs 50 日），只能手动修改代码反复运行，效率极低且容易出错。\n- **可视化门槛高**：为了直观查看收益曲线和交易点位，还需额外引入绘图库并编写专门的图表渲染代码。\n\n### 使用 fastquant 后\n- **一行代码取数**：直接调用 `get_stock_data` 即可获取雅虎财经或菲律宾交易所的历史行情，自动清洗并对齐数据格式。\n- **三行代码回测**：仅需导入 `backtest` 函数并指定策略名称（如 'smac'）及参数，瞬间完成从策略逻辑到资金曲线的完整回测。\n- **自动化网格搜索**：通过传入列表或范围参数，fastquant 能自动遍历多种均线周期组合，快速找出历史最优参数配置。\n- **结果即时呈现**：执行完毕后自动输出初始与最终资产值，并直接生成包含买卖标记的策略收益走势图，无需额外编码。\n\nfastquant 将原本需要数天搭建的量化回测流程压缩至几分钟，让投资者能专注于策略逻辑本身而非工程实现。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenzoampil_fastquant_ff8cba58.png","enzoampil","Lorenzo Ampil","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fenzoampil_268df2d4.png","co-founder \r\n@hawksightco  | systematic defi | creator of fastquant | contributor @flipsidecrypto  \r\n@huggingface | ai, nlp, mev ","hawkfi.ag","Singapore","lorenzojulioampil@gmail.com","AND__SO","https:\u002F\u002Fgithub.com\u002Fenzoampil",[82,86,90,94],{"name":83,"color":84,"percentage":85},"Jupyter Notebook","#DA5B0B",94.3,{"name":87,"color":88,"percentage":89},"Python","#3572A5",5.7,{"name":91,"color":92,"percentage":93},"Shell","#89e051",0,{"name":95,"color":96,"percentage":93},"Dockerfile","#384d54",1745,259,"2026-04-12T15:06:09","MIT",1,"未说明 (通常支持 Linux, macOS, Windows)","未说明 (无需 GPU，适用于常规回测任务)","未说明",{"notes":106,"python":107,"dependencies":108},"该工具主要用于金融策略回测，可通过 pip 直接安装。支持获取 Yahoo Finance、菲律宾股市及 Binance 加密货币数据。若使用新闻情感分析策略或 Prophet 预测模型，需额外注意数据日期一致性及安装对应可选依赖。支持 Docker 容器化部署。","未说明 (需安装 Python 环境以运行 pip 安装)",[109,110,111],"pandas","matplotlib","fbprophet (可选，用于自定义预测策略)",[16,113,14],"其他",[115,116,117,118,119,120,121,122,123],"trading-strategies","backtesting","stocks","financial-data-science","cryptocurrency","algotrading","quantitative-finance","data-science","machine-learning",null,"2026-03-27T02:49:30.150509","2026-04-13T04:23:11.960569",[128,133,138,143,148,152,157],{"id":129,"question_zh":130,"answer_zh":131,"source_url":132},31357,"如何在策略中访问除收盘价以外的高点、低点或完整数据？","可以通过自定义格式映射来访问完整数据。在 strategies.py 中添加如 'ohlcv' 的格式映射，并在策略初始化时扩展数据访问代码（例如添加 self.datahigh = self.datas[0].high 和 self.datalow = self.datas[0].low）。由于 CustomIndicator 的支持，输入 DataFrame 中的任何列（如高点、低点）都可以在策略层级通过 self.data 直接访问。","https:\u002F\u002Fgithub.com\u002Fenzoampil\u002Ffastquant\u002Fissues\u002F175",{"id":134,"question_zh":135,"answer_zh":136,"source_url":137},31358,"回测时如何处理股息（Dividends）？是否支持再投资？","fastquant 已支持股息功能。如果输入的 DataFrame 包含 'dividend' 列，默认情况下股息会被再投资用于购买更多股票（前提是资金足够）。若要关闭此功能，可以在 backtest 函数中显式设置 invest_div=False。此外，get_stock_data 函数在获取美国雅虎财经数据时也会自动包含股息数据。","https:\u002F\u002Fgithub.com\u002Fenzoampil\u002Ffastquant\u002Fissues\u002F336",{"id":139,"question_zh":140,"answer_zh":141,"source_url":142},31359,"如何同时对多个股票代码进行回测？","backtest 函数一次只处理一个 DataFrame。要回测多个标的，需要将获取的数据框存储在列表（数组）中，然后遍历该列表，将每个元素单独传递给 backtest 函数。示例代码如下：\n\n```\ndataframes = []\nfor tick in tickers:\n    dataframes.append(get_crypto(tick, ...))\n\nresults = []\nfor df in dataframes:\n    result = backtest(df, ...)\n    results.append(result)\n```","https:\u002F\u002Fgithub.com\u002Fenzoampil\u002Ffastquant\u002Fissues\u002F405",{"id":144,"question_zh":145,"answer_zh":146,"source_url":147},31360,"运行 get_pse_data 时出现 'AssertionError: Cache does not exist' 错误怎么办？","该错误通常是因为本地缓存文件缺失。解决方法是确保正确安装了包含数据文件的包。维护者已修复此问题，现在通过标准命令 pip install fastquant 安装即可正常工作，因为数据文件已明确上传到 PyPI。如果仍遇到问题，可以尝试在安装时更新 pandas 版本以避免导入错误。","https:\u002F\u002Fgithub.com\u002Fenzoampil\u002Ffastquant\u002Fissues\u002F66",{"id":149,"question_zh":150,"answer_zh":151,"source_url":132},31361,"在使用浮点数范围进行参数优化时遇到错误，该如何解决？","如果在参数扫描中使用自定义的 float 范围生成函数导致错误（特别是在测试运行时），建议直接使用 numpy 的 np.arange 函数替代。例如，将 af = range_with_floats(0.02, 0.04, 0.01) 替换为 af = np.arange(0.02, 0.04, 0.01)。np.arange 能更稳定地处理浮点数步长，避免生成器状态残留导致的问题。",{"id":153,"question_zh":154,"answer_zh":155,"source_url":156},31362,"fastquant 是否支持多策略组合回测？","是的，fastquant 已经集成了多策略支持。其基本思路是同时运行多个策略，并实例化一个最终策略来通过全局字典跟踪每个策略的输出。用户可以参考 Backtrader 社区关于运行和组合多个策略输出的讨论作为实现细节的参考。","https:\u002F\u002Fgithub.com\u002Fenzoampil\u002Ffastquant\u002Fissues\u002F113",{"id":158,"question_zh":159,"answer_zh":160,"source_url":147},31363,"获取 PSE 数据时，数据格式（format）参数有哪些限制？","get_pse_data 函数的 format 参数只能选择特定的列组合：要么是 'dcv'（日期、收盘价、成交量），要么是 'dohlc'（日期、开盘、最高、最低、收盘）。不能混合使用这两组的列（例如 'docv' 会导致开盘列出现 NaN），因为它们的数据来源不同。",[]]