[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-edtechre--pybroker":3,"tool-edtechre--pybroker":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 真正成长为懂上",146793,2,"2026-04-08T23:32:35",[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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108111,"2026-04-08T11:23:26",[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},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":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,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":75,"owner_location":75,"owner_email":75,"owner_twitter":75,"owner_website":76,"owner_url":77,"languages":78,"stars":83,"forks":84,"last_commit_at":85,"license":86,"difficulty_score":87,"env_os":88,"env_gpu":89,"env_ram":89,"env_deps":90,"category_tags":96,"github_topics":98,"view_count":32,"oss_zip_url":75,"oss_zip_packed_at":75,"status":17,"created_at":116,"updated_at":117,"faqs":118,"releases":147},5786,"edtechre\u002Fpybroker","pybroker","Algorithmic Trading in Python with Machine Learning","pybroker 是一个专为 Python 打造的量化交易框架，旨在帮助开发者利用机器学习构建和验证算法交易策略。它主要解决了传统回测工具速度慢、难以整合机器学习模型以及统计指标不够严谨等痛点，让用户能更高效地从数据中挖掘交易机会。\n\n这款工具特别适合具备一定编程基础的量化交易者、金融数据科学家以及算法研究人员使用。其核心技术亮点在于内置了基于 NumPy 和 Numba 加速的超快回测引擎，大幅缩短了策略验证时间。pybroker 支持灵活接入 Alpaca、Yahoo Finance 及 AKShare 等多种历史数据源，并提供了独特的“前向分析”（Walkforward Analysis）功能，能更真实地模拟实盘表现。此外，它还引入了随机自举法（Bootstrapping）来优化交易指标的可靠性，并通过并行计算与数据缓存机制进一步提升开发效率。无论是编写简单的规则策略，还是训练复杂的机器学习模型，pybroker 都能提供流畅的开发体验，助您打造数据驱动的交易系统。","\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fedtechre_pybroker_readme_2f96146c0b46.png\" alt=\"PyBroker\">\n\n[![python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-v3-brightgreen.svg)](https:\u002F\u002Fwww.python.org\u002F)\n[![Apache 2.0 with Commons Clause](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache%202.0%20Clause-green)](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Flicense.html)\n[![Documentation Status](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fedtechre_pybroker_readme_13d664e1afd7.png)](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002F?badge=latest)\n[![Package status](https:\u002F\u002Fgithub.com\u002Fedtechre\u002Fpybroker\u002Factions\u002Fworkflows\u002Fmain.yml\u002Fbadge.svg?event=push)](https:\u002F\u002Fgithub.com\u002Fedtechre\u002Fpybroker\u002Factions)\n[![Downloads](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fedtechre_pybroker_readme_2a91eb5861cb.png)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Flib-pybroker)\n[![Github stars](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fedtechre\u002Fpybroker?style=social)](https:\u002F\u002Fgithub.com\u002Fedtechre\u002Fpybroker\u002F)\n[![Twitter](https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Ffollow\u002Flibpybroker?style=social)](https:\u002F\u002Ftwitter.com\u002Fintent\u002Ffollow?screen_name=libpybroker)\n\n## Algorithmic Trading in Python with Machine Learning\n\nAre you looking to enhance your trading strategies with the power of Python and\nmachine learning? Then you need to check out **PyBroker**! This Python framework\nis designed for developing algorithmic trading strategies, with a focus on\nstrategies that use machine learning. With PyBroker, you can easily create and\nfine-tune trading rules, build powerful models, and gain valuable insights into\nyour strategy’s performance.\n\n## Key Features\n\n- A super-fast backtesting engine built in [NumPy](https:\u002F\u002Fnumpy.org\u002F) and accelerated with [Numba](https:\u002F\u002Fnumba.pydata.org\u002F).\n- The ability to create and execute trading rules and models across multiple instruments with ease.\n- Access to historical data from [Alpaca](https:\u002F\u002Falpaca.markets\u002F), [Yahoo Finance](https:\u002F\u002Ffinance.yahoo.com\u002F), [AKShare](https:\u002F\u002Fgithub.com\u002Fakfamily\u002Fakshare), or from [your own data provider](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F7.%20Creating%20a%20Custom%20Data%20Source.html).\n- The option to train and backtest models using [Walkforward Analysis](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F6.%20Training%20a%20Model.html#Walkforward-Analysis), which simulates how the strategy would perform during actual trading.\n- More reliable trading metrics that use randomized [bootstrapping](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FBootstrapping_(statistics)) to provide more accurate results.\n- Caching of downloaded data, indicators, and models to speed up your development process.\n- Parallelized computations that enable faster performance.\n\nWith PyBroker, you'll have all the tools you need to create winning trading\nstrategies backed by data and machine learning. Start using PyBroker today and\ntake your trading to the next level!\n\n## Installation\n\nPyBroker supports Python 3.9+ on Windows, Mac, and Linux. You can install\nPyBroker using ``pip``:\n\n```bash\n   pip install -U lib-pybroker\n```\n\nOr you can clone the Git repository with:\n\n```bash\n   git clone https:\u002F\u002Fgithub.com\u002Fedtechre\u002Fpybroker\n```\n\n## A Quick Example\n\nGet a glimpse of what backtesting with PyBroker looks like with these code\nsnippets:\n\n**Rule-based Strategy**:\n\n```python\n   from pybroker import Strategy, YFinance, highest\n\n   def exec_fn(ctx):\n      # Get the rolling 10 day high.\n      high_10d = ctx.indicator('high_10d')\n      # Buy on a new 10 day high.\n      if not ctx.long_pos() and high_10d[-1] > high_10d[-2]:\n         ctx.buy_shares = 100\n         # Hold the position for 5 days.\n         ctx.hold_bars = 5\n         # Set a stop loss of 2%.\n         ctx.stop_loss_pct = 2\n\n   strategy = Strategy(YFinance(), start_date='1\u002F1\u002F2022', end_date='7\u002F1\u002F2022')\n   strategy.add_execution(\n      exec_fn, ['AAPL', 'MSFT'], indicators=highest('high_10d', 'close', period=10))\n   # Run the backtest after 20 days have passed.\n   result = strategy.backtest(warmup=20)\n```\n\n**Model-based Strategy**:\n\n```python\n   import pybroker\n   from pybroker import Alpaca, Strategy\n\n   def train_fn(train_data, test_data, ticker):\n      # Train the model using indicators stored in train_data.\n      ...\n      return trained_model\n\n   # Register the model and its training function with PyBroker.\n   my_model = pybroker.model('my_model', train_fn, indicators=[...])\n\n   def exec_fn(ctx):\n      preds = ctx.preds('my_model')\n      # Open a long position given my_model's latest prediction.\n      if not ctx.long_pos() and preds[-1] > buy_threshold:\n         ctx.buy_shares = 100\n      # Close the long position given my_model's latest prediction.\n      elif ctx.long_pos() and preds[-1] \u003C sell_threshold:\n         ctx.sell_all_shares()\n\n   alpaca = Alpaca(api_key=..., api_secret=...)\n   strategy = Strategy(alpaca, start_date='1\u002F1\u002F2022', end_date='7\u002F1\u002F2022')\n   strategy.add_execution(exec_fn, ['AAPL', 'MSFT'], models=my_model)\n   # Run Walkforward Analysis on 1 minute data using 5 windows with 50\u002F50 train\u002Ftest data.\n   result = strategy.walkforward(timeframe='1m', windows=5, train_size=0.5)\n```\n\n## User Guide\n\n- [Getting Started with Data Sources](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F1.%20Getting%20Started%20with%20Data%20Sources.html)\n- [Backtesting a Strategy](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F2.%20Backtesting%20a%20Strategy.html)\n- [Evaluating with Bootstrap Metrics](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F3.%20Evaluating%20with%20Bootstrap%20Metrics.html)\n- [Ranking and Position Sizing](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F4.%20Ranking%20and%20Position%20Sizing.html)\n- [Writing Indicators](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F5.%20Writing%20Indicators.html)\n- [Training a Model](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F6.%20Training%20a%20Model.html)\n- [Creating a Custom Data Source](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F7.%20Creating%20a%20Custom%20Data%20Source.html)\n- [Applying Stops](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F8.%20Applying%20Stops.html)\n- [Rebalancing Positions](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F9.%20Rebalancing%20Positions.html)\n- [Rotational Trading](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F10.%20Rotational%20Trading.html)\n- [FAQs](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002FFAQs.html)\n\n## Online Documentation\n\n[The full reference documentation is hosted at **www.pybroker.com**.](https:\u002F\u002Fwww.pybroker.com)\n\n(For Chinese users: [中文文档](https:\u002F\u002Fwww.pybroker.com\u002Fzh_CN\u002Flatest\u002F), courtesy of [Albert King](https:\u002F\u002Fgithub.com\u002Falbertandking).)\n\n## Contact\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fedtechre_pybroker_readme_22907cb2f1d6.png\">\n\n## Market-Moving Stock News & Alerts\n\n**AI-driven market analysis for the stocks you follow.** Receive real-time AI alerts and sentiment analysis for 10,000+ tickers at [www.movealerts.ai](https:\u002F\u002Fwww.movealerts.ai).\n","\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fedtechre_pybroker_readme_2f96146c0b46.png\" alt=\"PyBroker\">\n\n[![python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-v3-brightgreen.svg)](https:\u002F\u002Fwww.python.org\u002F)\n[![Apache 2.0 with Commons Clause](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache%202.0%20Clause-green)](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Flicense.html)\n[![Documentation Status](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fedtechre_pybroker_readme_13d664e1afd7.png)](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002F?badge=latest)\n[![Package status](https:\u002F\u002Fgithub.com\u002Fedtechre\u002Fpybroker\u002Factions\u002Fworkflows\u002Fmain.yml\u002Fbadge.svg?event=push)](https:\u002F\u002Fgithub.com\u002Fedtechre\u002Fpybroker\u002Factions)\n[![Downloads](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fedtechre_pybroker_readme_2a91eb5861cb.png)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Flib-pybroker)\n[![Github stars](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fedtechre\u002Fpybroker?style=social)](https:\u002F\u002Fgithub.com\u002Fedtechre\u002Fpybroker\u002F)\n[![Twitter](https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Ffollow\u002Flibpybroker?style=social)](https:\u002F\u002Ftwitter.com\u002Fintent\u002Ffollow?screen_name=libpybroker)\n\n## 使用机器学习的 Python 算法交易\n\n您是否希望借助 Python 和机器学习的力量来提升您的交易策略？那么您一定要了解 **PyBroker**！这个 Python 框架专为开发算法交易策略而设计，尤其适用于基于机器学习的策略。通过 PyBroker，您可以轻松创建和优化交易规则、构建强大的模型，并深入了解策略的表现。\n\n## 核心功能\n\n- 基于 [NumPy](https:\u002F\u002Fnumpy.org\u002F) 构建的超快速回测引擎，并通过 [Numba](https:\u002F\u002Fnumba.pydata.org\u002F) 加速。\n- 能够轻松地在多个交易品种上创建和执行交易规则与模型。\n- 支持从 [Alpaca](https:\u002F\u002Falpaca.markets\u002F)、[Yahoo Finance](https:\u002F\u002Ffinance.yahoo.com\u002F)、[AKShare](https:\u002F\u002Fgithub.com\u002Fakfamily\u002Fakshare) 或者您自己的数据提供商获取历史数据（详情请参阅：[自定义数据源](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F7.%20Creating%20a%20Custom%20Data%20Source.html)）。\n- 提供 [向前测试分析](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F6.%20Training%20a%20Model.html#Walkforward-Analysis)，模拟策略在实际交易中的表现。\n- 更可靠的交易指标，采用随机化的 [自助法](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FBootstrapping_(statistics)) 来提供更准确的结果。\n- 对下载的数据、指标和模型进行缓存，以加快开发速度。\n- 并行计算支持，显著提升性能。\n\n借助 PyBroker，您将拥有所有必要的工具，用数据和机器学习打造制胜的交易策略。立即开始使用 PyBroker，让您的交易更上一层楼！\n\n## 安装\n\nPyBroker 支持 Python 3.9 及以上版本，可在 Windows、Mac 和 Linux 上运行。您可以通过 `pip` 安装 PyBroker：\n\n```bash\n   pip install -U lib-pybroker\n```\n\n或者直接克隆 Git 仓库：\n\n```bash\n   git clone https:\u002F\u002Fgithub.com\u002Fedtechre\u002Fpybroker\n```\n\n## 快速示例\n\n以下代码片段展示了使用 PyBroker 进行回测的基本操作：\n\n**基于规则的策略**：\n\n```python\n   from pybroker import Strategy, YFinance, highest\n\n   def exec_fn(ctx):\n      # 获取过去10天的滚动高点。\n      high_10d = ctx.indicator('high_10d')\n      # 当出现新的10日高点时买入。\n      if not ctx.long_pos() && high_10d[-1] > high_10d[-2]:\n         ctx.buy_shares = 100\n         # 持仓5天。\n         ctx.hold_bars = 5\n         # 设置2%的止损。\n         ctx.stop_loss_pct = 2\n\n   strategy = Strategy(YFinance(), start_date='1\u002F1\u002F2022', end_date='7\u002F1\u002F2022')\n   strategy.add_execution(\n      exec_fn, ['AAPL', 'MSFT'], indicators=highest('high_10d', 'close', period=10))\n   # 在预热20天后运行回测。\n   result = strategy.backtest(warmup=20)\n```\n\n**基于模型的策略**：\n\n```python\n   import pybroker\n   from pybroker import Alpaca, Strategy\n\n   def train_fn(train_data, test_data, ticker):\n      # 使用train_data中存储的指标训练模型。\n      ...\n      return trained_model\n\n   # 将模型及其训练函数注册到PyBroker。\n   my_model = pybroker.model('my_model', train_fn, indicators=[...])\n\n   def exec_fn(ctx):\n      preds = ctx.preds('my_model')\n      # 根据模型的最新预测开立多头仓位。\n      if not ctx.long_pos() && preds[-1] > buy_threshold:\n         ctx.buy_shares = 100\n      # 根据模型的最新预测平仓多头仓位。\n      elif ctx.long_pos() && preds[-1] \u003C sell_threshold:\n         ctx.sell_all_shares()\n\n   alpaca = Alpaca(api_key=..., api_secret=...)\n   strategy = Strategy(alpaca, start_date='1\u002F1\u002F2022', end_date='7\u002F1\u002F2022')\n   strategy.add_execution(exec_fn, ['AAPL', 'MSFT'], models=my_model)\n   # 使用5个窗口，每窗口50\u002F50的训练\u002F测试数据，在1分钟级别上运行向前测试分析。\n   result = strategy.walkforward(timeframe='1m', windows=5, train_size=0.5)\n```\n\n## 用户指南\n\n- [数据源入门](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F1.%20Getting%20Started%20with%20Data%20Sources.html)\n- [策略回测](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F2.%20Backtesting%20a%20Strategy.html)\n- [使用自助法指标评估](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F3.%20Evaluating%20with%20Bootstrap%20Metrics.html)\n- [排名与仓位管理](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F4.%20Ranking%20and%20Position%20Sizing.html)\n- [编写指标](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F5.%20Writing%20Indicators.html)\n- [训练模型](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F6.%20Training%20a%20Model.html)\n- [创建自定义数据源](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F7.%20Creating%20a%20Custom%20Data%20Source.html)\n- [设置止损](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F8.%20Applying%20Stops.html)\n- [调整仓位](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F9.%20Rebalancing%20Positions.html)\n- [轮动交易](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F10.%20Rotational%20Trading.html)\n- [常见问题解答](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002FFAQs.html)\n\n## 在线文档\n\n完整的参考文档托管在 **www.pybroker.com** 上。（中文用户可参阅：[中文文档](https:\u002F\u002Fwww.pybroker.com\u002Fzh_CN\u002Flatest\u002F)，由 [Albert King](https:\u002F\u002Fgithub.com\u002Falbertandking) 提供。）\n\n## 联系方式\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fedtechre_pybroker_readme_22907cb2f1d6.png\">\n\n## 影响市场的股票新闻与预警\n\n**为您关注的股票提供人工智能驱动的市场分析。** 在 [www.movealerts.ai](https:\u002F\u002Fwww.movealerts.ai) 上，您可以实时接收超过1万只股票的人工智能预警和情绪分析。","# PyBroker 快速上手指南\n\nPyBroker 是一个专为 Python 设计的高性能算法交易框架，特别侧重于结合机器学习构建交易策略。它拥有基于 NumPy 和 Numba 加速的回测引擎，支持多标的交易、前向分析（Walkforward Analysis）以及更可靠的自举法（Bootstrapping）评估指标。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**：Windows、macOS 或 Linux\n*   **Python 版本**：3.9 或更高版本\n*   **核心依赖**：安装过程会自动处理 `numpy`、`numba` 等依赖库。\n\n> **提示**：为了获得最佳性能，建议在虚拟环境（如 `venv` 或 `conda`）中进行安装。\n\n## 安装步骤\n\n您可以使用 `pip` 直接安装最新版本的 PyBroker：\n\n```bash\npip install -U lib-pybroker\n```\n\n如果您希望获取源代码或参与贡献，也可以克隆 Git 仓库：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fedtechre\u002Fpybroker\n```\n\n## 基本使用\n\nPyBroker 支持两种主要的策略开发模式：**基于规则的策略**和**基于模型的策略**。以下是两个最简化的示例，展示如何快速启动回测。\n\n### 1. 基于规则的策略 (Rule-based Strategy)\n\n此示例演示如何使用 Yahoo Finance 数据，当价格突破 10 日新高时买入，并持有 5 天。\n\n```python\nfrom pybroker import Strategy, YFinance, highest\n\ndef exec_fn(ctx):\n    # 获取滚动 10 日最高价指标\n    high_10d = ctx.indicator('high_10d')\n    # 如果当前没有持仓，且最新收盘价突破前一日的高点（即创 10 日新高）\n    if not ctx.long_pos() and high_10d[-1] > high_10d[-2]:\n        ctx.buy_shares = 100       # 买入 100 股\n        ctx.hold_bars = 5          # 持有 5 个周期\n        ctx.stop_loss_pct = 2      # 设置 2% 的止损\n\n# 初始化策略，使用 Yahoo Finance 数据源\nstrategy = Strategy(YFinance(), start_date='1\u002F1\u002F2022', end_date='7\u002F1\u002F2022')\n\n# 添加执行逻辑和指标定义\nstrategy.add_execution(\n    exec_fn, ['AAPL', 'MSFT'], indicators=highest('high_10d', 'close', period=10))\n\n# 运行回测（设置 20 天的预热期以计算指标）\nresult = strategy.backtest(warmup=20)\n```\n\n### 2. 基于模型的策略 (Model-based Strategy)\n\n此示例演示如何注册一个自定义训练函数，并使用前向分析（Walkforward Analysis）在分钟级数据上进行回测。\n\n```python\nimport pybroker\nfrom pybroker import Alpaca, Strategy\n\ndef train_fn(train_data, test_data, ticker):\n    # 在此处使用 train_data 中的指标训练您的机器学习模型\n    # ...\n    return trained_model\n\n# 向 PyBroker 注册模型及其训练函数\nmy_model = pybroker.model('my_model', train_fn, indicators=[...])\n\ndef exec_fn(ctx):\n    preds = ctx.preds('my_model')\n    # 根据模型预测开仓\n    if not ctx.long_pos() and preds[-1] > buy_threshold:\n        ctx.buy_shares = 100\n    # 根据模型预测平仓\n    elif ctx.long_pos() and preds[-1] \u003C sell_threshold:\n        ctx.sell_all_shares()\n\n# 配置数据源（此处以 Alpaca 为例，需填入 API 密钥）\nalpaca = Alpaca(api_key='YOUR_API_KEY', api_secret='YOUR_API_SECRET')\n\n# 初始化策略\nstrategy = Strategy(alpaca, start_date='1\u002F1\u002F2022', end_date='7\u002F1\u002F2022')\n\n# 添加执行逻辑和模型\nstrategy.add_execution(exec_fn, ['AAPL', 'MSFT'], models=my_model)\n\n# 运行前向分析：使用 1 分钟数据，分为 5 个窗口，训练集占比 50%\nresult = strategy.walkforward(timeframe='1m', windows=5, train_size=0.5)\n```\n\n完成上述步骤后，您即可通过 `result` 对象查看详细的回测报告和绩效指标。更多高级功能（如自定义数据源、仓位管理等）请参考官方文档。","一位量化交易研究员正试图将基于机器学习的预测模型应用于多只科技股的趋势跟踪策略，并需要验证其在真实市场环境下的稳健性。\n\n### 没有 pybroker 时\n- **回测效率低下**：使用纯 Python 循环处理历史数据，计算技术指标和模拟交易逻辑速度极慢，调整一次参数需等待数小时。\n- **模型验证困难**：缺乏内置的“前向分析”（Walkforward Analysis）机制，难以模拟实盘中模型随时间动态训练的过程，导致过拟合风险高。\n- **数据源分散**：需要手动编写代码分别从 Yahoo Finance 或券商 API 抓取数据，格式不统一且无法自动缓存，重复开发成本高。\n- **统计指标单一**：仅能计算基础收益率，缺乏基于自助法（Bootstrapping）的随机化检验，无法评估策略在极端市场下的真实可靠性。\n\n### 使用 pybroker 后\n- **极速回测引擎**：利用 NumPy 和 Numba 加速的计算内核，将原本数小时的回测过程缩短至秒级，支持快速迭代数百种参数组合。\n- **严谨的模型训练**：直接调用内置的前向分析功能，自动按时间窗口滚动训练机器学习模型并测试，确保策略逻辑符合实盘推演。\n- **一站式数据管理**：通过简单配置即可接入 Alpaca、Yahoo Finance 等主流数据源，自动完成数据下载、清洗与本地缓存，开箱即用。\n- **深度绩效评估**：内置基于随机抽样的统计检验工具，提供更可信的风险调整后收益指标，帮助识别策略是否真正具备阿尔法能力。\n\npybroker 让量化开发者能从繁琐的基础设施搭建中解放出来，专注于利用机器学习构建真正具备实战价值的高频交易策略。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fedtechre_pybroker_e2981ca3.png","edtechre","Ed West","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fedtechre_3b11fa48.jpg",null,"https:\u002F\u002Fwww.pybroker.com","https:\u002F\u002Fgithub.com\u002Fedtechre",[79],{"name":80,"color":81,"percentage":82},"Python","#3572A5",100,3260,420,"2026-04-08T12:12:40","NOASSERTION",1,"Windows, macOS, Linux","未说明",{"notes":91,"python":92,"dependencies":93},"该工具是一个基于规则和机器学习的算法交易框架，内置高性能回测引擎。支持从 Alpaca、Yahoo Finance、AKShare 获取数据或自定义数据源。安装命令为 pip install -U lib-pybroker。文档提供中文版本。","3.9+",[94,95],"NumPy","Numba",[97,14,15,13,16],"其他",[99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115],"algotrading","backtesting","machine-learning","python","trading","quantitative-finance","stocks","framework","investment","ai","artificial-intelligence","algorithmic-trading","data-science","finance","trading-strategies","crypto","cryptocurrency","2026-03-27T02:49:30.150509","2026-04-09T12:33:51.679796",[119,124,129,134,139,143],{"id":120,"question_zh":121,"answer_zh":122,"source_url":123},26224,"如何在实盘交易或增量回测中保存和复用 Portfolio 对象？","目前 PyBroker 原生不支持直接 pickle（序列化）Portfolio 对象以便在后续运行中加载。官方建议是：如果您需要可靠的实盘执行框架，应考虑购买具有活跃开发团队和可持续商业模式的专业解决方案，而不是自行实现实盘交易功能。对于高级用户，可以通过继承 Strategy 类并重写相关方法来自定义扩展，但这并非官方推荐的整洁方式。维护者指出，实盘下单与回测软件中的下单完全不同，甚至模拟账户也与真实市场不同。","https:\u002F\u002Fgithub.com\u002Fedtechre\u002Fpybroker\u002Fissues\u002F68",{"id":125,"question_zh":126,"answer_zh":127,"source_url":128},26225,"如何正确处理回测中的预热期（warmup period）以避免数据偏移？","由于在从数据源（如 Yahoo Finance, Alpaca）查询数据之前无法确定减去预热期后的新开始时间，因此直接在策略中减去预热期是不可行的。推荐的解决方案是：先从数据源查询完整的 DataFrame，然后从您预期的开始日期中减去预热期长度，计算出 DataFrame 中实际用于回测的偏移起始日期（offset start_date）。例如，如果您的指标需要 200 天数据（如 SMA 200），则应将 warmup 设为 200，在获取数据后手动切片 DataFrame，确保回测逻辑从正确的日期开始执行。","https:\u002F\u002Fgithub.com\u002Fedtechre\u002Fpybroker\u002Fissues\u002F51",{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},26226,"最终的市场价值（end_market_value）、已实现盈亏（PnL）和未实现盈亏（unrealized PnL）之间是如何计算的？为什么数值看起来不匹配？","该问题曾在 v1.0.19 版本中被确认为一个 Bug 并已修复。在修复前，总权益（total equity）和盈亏（PnL）的计算存在不一致。维护者已在 commit 153340c72f7ab8bfa94ffe3523ee828400c9ffd9 中提交了修复代码。如果您发现最终市场价值远小于已实现盈亏与未实现盈亏之和，请确保您已升级到 v1.0.19 或更高版本。升级后，各项指标应能正确对账。","https:\u002F\u002Fgithub.com\u002Fedtechre\u002Fpybroker\u002Fissues\u002F7",{"id":135,"question_zh":136,"answer_zh":137,"source_url":138},26227,"运行时出现 \"Native library not available\" 错误怎么办？","此错误通常与 py_mini_racer 依赖的原生库缺失有关。临时解决方案是将特定的 DataSource（如 AKShare）移动到单独的模块中，除非您显式导入它，否则不会触发该错误。维护者已通过更新 PyBroker 将 AKShare DataSource 分离来解决此问题。如果遇到此错误，请尝试更新到最新版本，或者检查您的环境中是否正确安装了所需的原生库文件（如 libmini_racer.dylib）。","https:\u002F\u002Fgithub.com\u002Fedtechre\u002Fpybroker\u002Fissues\u002F36",{"id":140,"question_zh":141,"answer_zh":142,"source_url":123},26228,"PyBroker 是否适合直接用于生产环境的实盘交易？","虽然 PyBroker 设计良好、易于扩展且维护积极，非常适合策略研究和回测，但社区资深用户建议：对于寻找可靠交易执行框架的用户（特别是在已经找到可靠策略并准备实盘时），最好付费购买拥有活跃开发团队和可持续商业模式的成熟解决方案。因为在真实市场中下单与在回测软件或模拟账户中下单完全不同，自行实现实盘交易功能存在较高风险，这适用于 99.999% 的算法交易参与者。",{"id":144,"question_zh":145,"answer_zh":146,"source_url":128},26229,"Strategy 类中的 start_date\u002Fend_date 参数与 backtest 方法中的参数有什么区别？","两者用途不同：`Strategy(start_date, end_date)` 用于定义从数据源获取数据的时间区间；而 `Strategy.backtest(start_date, end_date)` 用于定义实际进行回测交易的时间区间。当使用 `warmup` 参数时，系统会从 backtest 的 start_date 向前推算 warmup 长度的时间来获取足够的数据以计算指标，但实际交易信号是从 backtest 指定的 start_date 之后（即加上 warmup 偏移后）才开始生成的。用户需注意区分数据获取范围与实际交易范围。",[148,153,158,163,168,173,178,183,188,193,198,203,208,213,218,223,228,233,238,243],{"id":149,"version":150,"summary_zh":151,"released_at":152},166725,"v1.2.12","- 现在支持 Pandas 3","2026-03-05T04:45:00",{"id":154,"version":155,"summary_zh":156,"released_at":157},166726,"v1.2.11","- 修复由 Pandas 2.3 返回的只读 NumPy 数组引起的错误。\n- 新增 pybroker.clear_params 函数，用于清除全局参数。\n- 将 [Strategy#add_execution](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.strategy.html#pybroker.strategy.Strategy.add_execution) 中的 *args 和 **kwargs 原封不动地传递给执行函数。\n- 为 [Strategy#backtest](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.strategy.html#pybroker.strategy.Strategy.backtest) 和 [Strategy#walkforward](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.strategy.html#pybroker.strategy.Strategy.walkforward) 添加 seed 参数，以实现可复现的自助抽样结果。\n- 移除了冗余的 subtract_fees 配置选项。","2025-12-05T17:16:25",{"id":159,"version":160,"summary_zh":161,"released_at":162},166727,"v1.2.10","- 更新夏普比率、索提诺比率和卡玛比率的计算方法，改用每根柱线收益率而非每根柱线的绝对涨跌幅。","2025-07-02T23:44:38",{"id":164,"version":165,"summary_zh":166,"released_at":167},166728,"v1.2.9","- 升级到 NumPy 2.x，同时仍支持 NumPy 1.x。  \n- 新增 [LONG_ONLY](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.config.html#pybroker.config.StrategyConfig.position_mode) 和 [SHORT_ONLY](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.config.html#pybroker.config.StrategyConfig.position_mode) 配置选项，用于运行仅做多和仅做空的策略。  \n- 在 [TestResult](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.strategy.html#pybroker.strategy.TestResult) 返回的评估指标中，新增 [max_drawdown_date](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.eval.html#pybroker.eval.EvalMetrics.max_drawdown_date)。  \n- 修复了 yfinance 依赖库的版本问题。","2025-04-13T05:31:25",{"id":169,"version":170,"summary_zh":171,"released_at":172},166729,"v1.2.7","- 修复了当 DataFrame 对象的 `df.index.is_unique` 为 False 时，`df.loc[index]` 返回 DataFrame 类型的问题。","2025-03-12T01:43:14",{"id":174,"version":175,"summary_zh":176,"released_at":177},166730,"v1.2.6","- 修复了 yfinance 数据中缺失的 Adjusted Close 列问题。为 YFinance 数据源添加了 [auto_adjust](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Fdev\u002Freference\u002Fpybroker.data.html#pybroker.data.YFinance) 参数，默认值设为 False，这样就会返回 Adjusted Close 列。\n- 如果在没有未平仓头寸的情况下调用 [sell_all_shares](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Fdev\u002Freference\u002Fpybroker.context.html#pybroker.context.ExecContext.sell_all_shares) 或 [cover_all_shares](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Fdev\u002Freference\u002Fpybroker.context.html#pybroker.context.ExecContext.cover_all_shares)，则会抛出错误。","2025-01-08T01:37:41",{"id":179,"version":180,"summary_zh":181,"released_at":182},166731,"v1.2.5","- 在 [Strategy#backtest](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.strategy.html#pybroker.strategy.Strategy.backtest) 和 [Strategy#walkforward](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.strategy.html#pybroker.strategy.Strategy.walkforward) 中添加了 DataSource 调整参数。\n- 修复了 mypy 类型检查错误。","2024-11-15T07:45:02",{"id":184,"version":185,"summary_zh":186,"released_at":187},166732,"v1.2.4","确保 [largest_loss_pct](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.eval.html#pybroker.eval.EvalMetrics.largest_loss_pct) 始终为负值，而 [largest_win_pct](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.eval.html#pybroker.eval.EvalMetrics.largest_win_pct) 始终为正值。","2024-09-22T21:59:38",{"id":189,"version":190,"summary_zh":191,"released_at":192},166733,"v1.2.3","添加了以下内置指标：\n\n- [ADX](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.adx)\n- [Aroon 差值](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.aroon_diff)\n- [Aroon 下降线](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.aroon_down)\n- [Aroon 上升线](https:\u002F\u002Fpybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.aroon_up)\n- [收盘价减移动平均线](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.close_minus_ma)\n- [三次偏差](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.cubic_deviation)\n- [三次趋势](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.cubic_trend)\n- [资金流量差值](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.delta_on_balance_volume)\n- [去趋势 RSI](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.detrended_rsi)\n- [盘中强度](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.intraday_intensity)\n- [拉盖尔 RSI](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.laguerre_rsi)\n- [线性偏差](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.linear_deviation)\n- [线性趋势](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.linear_trend)\n- [MACD](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.macd)\n- [查伊坎资金流量](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.money_flow)\n- [归一化负成交量指数](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.normalized_negative_volume_index)\n- [归一化资金流量](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.normalized_on_balance_volume)\n- [归一化正成交量指数](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.normalized_positive_volume_index)\n- [价格变化振荡器](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.price_change_oscillator)\n- [价格强度](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.price_intensity)\n- [价格成交量拟合](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.price_volume_fit)\n- [二次偏差](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.quadratic_deviation)\n- [二次趋势](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.indicator.html#pybroker.indicator.quadratic_trend)\n- [反应性","2024-09-16T05:30:30",{"id":194,"version":195,"summary_zh":196,"released_at":197},166734,"v1.2.2","- 修复了在设置了[滑点模型](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.strategy.html#pybroker.strategy.Strategy.set_slippage_model)时无法平仓的问题。现在，调用[ctx.sell_all_shares()](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.context.html#pybroker.context.ExecContext.sell_all_shares)或[ctx.cover_all_shares()](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.context.html#pybroker.context.ExecContext.cover_all_shares)将强制平仓，即使已设置滑点模型。\n- 将[ExecSignal](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.context.html#pybroker.context.ExecSignal)和[PosSizeContext](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.context.html#pybroker.context.PosSizeContext)添加到全局导入中。","2024-09-09T05:29:21",{"id":199,"version":200,"summary_zh":201,"released_at":202},166735,"v1.2.1","- Reverts Numpy requirement to v1 for better compatibility with notebook dependencies.\r\n\r\n- Fixes bug so that last bar of data is always used in the test split when the number of train\u002Ftest windows is 1.","2024-08-13T03:10:06",{"id":204,"version":205,"summary_zh":206,"released_at":207},166736,"v1.1.40","Fixes bug so that last bar of data is always used in the test split when the number of train\u002Ftest windows is 1.","2024-08-12T02:29:15",{"id":209,"version":210,"summary_zh":211,"released_at":212},166737,"v1.1.39","Reverts Numpy requirement to v1 for better compatibility with notebook dependencies.","2024-07-04T21:42:57",{"id":214,"version":215,"summary_zh":216,"released_at":217},166738,"v1.1.38","- Adds [YQuery data source](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Fdev\u002Freference\u002Fpybroker.ext.data.html#pybroker.ext.data.YQuery) for fetching data from Yahoo Finance using the [Yahooquery library](https:\u002F\u002Fgithub.com\u002Fdpguthrie\u002Fyahooquery).\r\n- Sorts execution symbols before backtest to make results deterministic for easier debugging. It is still recommended to use [bootstrap metrics](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Fnotebooks\u002F3.%20Evaluating%20with%20Bootstrap%20Metrics.html) to evaluate your strategy.","2024-06-23T06:27:07",{"id":219,"version":220,"summary_zh":221,"released_at":222},166739,"v1.1.37","- Fixes [pybroker.param](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.scope.html#pybroker.scope.param) to support non-primitive value types.\r\n- Disables YFinance progress bar if [logging is disabled](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.scope.html#pybroker.scope.disable_logging) or [progress bar is disabled](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.scope.html#pybroker.scope.disable_progress_bar).","2024-05-09T05:17:24",{"id":224,"version":225,"summary_zh":226,"released_at":227},166740,"v1.1.36","Adds [return_stops](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.config.html#pybroker.config.StrategyConfig.return_stops) config option for recording stop data per-bar.","2024-04-20T05:49:41",{"id":229,"version":230,"summary_zh":231,"released_at":232},166741,"v1.1.35","Removes all stops for a position when [ctx.sell_all_shares](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.context.html#pybroker.context.ExecContext.sell_all_shares)  or [ctx.cover_all_shares](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.context.html#pybroker.context.ExecContext.cover_all_shares) is called.","2024-04-09T04:20:49",{"id":234,"version":235,"summary_zh":236,"released_at":237},166742,"v1.1.33","Adds maximum adverse excursion (MAE) and maximum favorable excursion (MFE) metrics to [trades](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.strategy.html#pybroker.strategy.TestResult.trades).","2024-03-24T05:01:25",{"id":239,"version":240,"summary_zh":241,"released_at":242},166743,"v1.1.32","- Updates to Pandas 2.0.\r\n- Adds [subtract_fees](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.config.html#pybroker.config.StrategyConfig.subtract_fees) config option for subtracting fees from the cash balance after an order is filled.","2024-03-17T03:33:05",{"id":244,"version":245,"summary_zh":246,"released_at":247},166744,"v1.1.31","- Adds [return_signals](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.config.html#pybroker.config.StrategyConfig.return_signals) config option. When set to true, return bar data, indicator data, and model predictions per symbol as part of backtest results.\r\n- Adds support for [custom fee calculation](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.config.html#pybroker.config.StrategyConfig.fee_mode).\r\n- Add optional [Portfolio argument to backtest\u002Fwalkforward methods](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.strategy.html#pybroker.strategy.Strategy.walkforward).\r\n- Adds [round_test_result config option](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.config.html#pybroker.config.StrategyConfig.round_test_result) which allows users to disable rounding values in [TestResult]().\r\n- Adds [round_fill_price](https:\u002F\u002Fwww.pybroker.com\u002Fen\u002Flatest\u002Freference\u002Fpybroker.config.html#pybroker.config.StrategyConfig.round_fill_price) config option. Rounds fill prices to the nearest cent, enabled by default.\r\n- Updates code for Pandas 2 compatibility.","2024-01-20T02:27:32"]