[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-enarjord--passivbot":3,"tool-enarjord--passivbot":65},[4,23,32,40,49,57],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":22},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",85092,2,"2026-04-10T11:13:16",[13,14,15,16,17,18,19,20,21],"图像","数据工具","视频","插件","Agent","其他","语言模型","开发框架","音频","ready",{"id":24,"name":25,"github_repo":26,"description_zh":27,"stars":28,"difficulty_score":29,"last_commit_at":30,"category_tags":31,"status":22},5784,"funNLP","fighting41love\u002FfunNLP","funNLP 是一个专为中文自然语言处理（NLP）打造的超级资源库，被誉为\"NLP 民工的乐园”。它并非单一的软件工具，而是一个汇集了海量开源项目、数据集、预训练模型和实用代码的综合性平台。\n\n面对中文 NLP 领域资源分散、入门门槛高以及特定场景数据匮乏的痛点，funNLP 提供了“一站式”解决方案。这里不仅涵盖了分词、命名实体识别、情感分析、文本摘要等基础任务的标准工具，还独特地收录了丰富的垂直领域资源，如法律、医疗、金融行业的专用词库与数据集，甚至包含古诗词生成、歌词创作等趣味应用。其核心亮点在于极高的全面性与实用性，从基础的字典词典到前沿的 BERT、GPT-2 模型代码，再到高质量的标注数据和竞赛方案，应有尽有。\n\n无论是刚刚踏入 NLP 领域的学生、需要快速验证想法的算法工程师，还是从事人工智能研究的学者，都能在这里找到急需的“武器弹药”。对于开发者而言，它能大幅减少寻找数据和复现模型的时间；对于研究者，它提供了丰富的基准测试资源和前沿技术参考。funNLP 以开放共享的精神，极大地降低了中文自然语言处理的开发与研究成本，是中文 AI 社区不可或缺的宝藏仓库。",79857,1,"2026-04-08T20:11:31",[19,14,18],{"id":33,"name":34,"github_repo":35,"description_zh":36,"stars":37,"difficulty_score":29,"last_commit_at":38,"category_tags":39,"status":22},5773,"cs-video-courses","Developer-Y\u002Fcs-video-courses","cs-video-courses 是一个精心整理的计算机科学视频课程清单，旨在为自学者提供系统化的学习路径。它汇集了全球知名高校（如加州大学伯克利分校、新南威尔士大学等）的完整课程录像，涵盖从编程基础、数据结构与算法，到操作系统、分布式系统、数据库等核心领域，并深入延伸至人工智能、机器学习、量子计算及区块链等前沿方向。\n\n面对网络上零散且质量参差不齐的教学资源，cs-video-courses 解决了学习者难以找到成体系、高难度大学级别课程的痛点。该项目严格筛选内容，仅收录真正的大学层级课程，排除了碎片化的简短教程或商业广告，确保用户能接触到严谨的学术内容。\n\n这份清单特别适合希望夯实计算机基础的开发者、需要补充特定领域知识的研究人员，以及渴望像在校生一样系统学习计算机科学的自学者。其独特的技术亮点在于分类极其详尽，不仅包含传统的软件工程与网络安全，还细分了生成式 AI、大语言模型、计算生物学等新兴学科，并直接链接至官方视频播放列表，让用户能一站式获取高质量的教育资源，免费享受世界顶尖大学的课堂体验。",79792,"2026-04-08T22:03:59",[18,13,14,20],{"id":41,"name":42,"github_repo":43,"description_zh":44,"stars":45,"difficulty_score":46,"last_commit_at":47,"category_tags":48,"status":22},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,3,"2026-04-04T04:44:48",[17,13,20,19,18],{"id":50,"name":51,"github_repo":52,"description_zh":53,"stars":54,"difficulty_score":46,"last_commit_at":55,"category_tags":56,"status":22},519,"PaddleOCR","PaddlePaddle\u002FPaddleOCR","PaddleOCR 是一款基于百度飞桨框架开发的高性能开源光学字符识别工具包。它的核心能力是将图片、PDF 等文档中的文字提取出来，转换成计算机可读取的结构化数据，让机器真正“看懂”图文内容。\n\n面对海量纸质或电子文档，PaddleOCR 解决了人工录入效率低、数字化成本高的问题。尤其在人工智能领域，它扮演着连接图像与大型语言模型（LLM）的桥梁角色，能将视觉信息直接转化为文本输入，助力智能问答、文档分析等应用场景落地。\n\nPaddleOCR 适合开发者、算法研究人员以及有文档自动化需求的普通用户。其技术优势十分明显：不仅支持全球 100 多种语言的识别，还能在 Windows、Linux、macOS 等多个系统上运行，并灵活适配 CPU、GPU、NPU 等各类硬件。作为一个轻量级且社区活跃的开源项目，PaddleOCR 既能满足快速集成的需求，也能支撑前沿的视觉语言研究，是处理文字识别任务的理想选择。",75644,"2026-04-15T10:48:40",[19,13,20,18],{"id":58,"name":59,"github_repo":60,"description_zh":61,"stars":62,"difficulty_score":29,"last_commit_at":63,"category_tags":64,"status":22},3215,"awesome-machine-learning","josephmisiti\u002Fawesome-machine-learning","awesome-machine-learning 是一份精心整理的机器学习资源清单，汇集了全球优秀的机器学习框架、库和软件工具。面对机器学习领域技术迭代快、资源分散且难以甄选的痛点，这份清单按编程语言（如 Python、C++、Go 等）和应用场景（如计算机视觉、自然语言处理、深度学习等）进行了系统化分类，帮助使用者快速定位高质量项目。\n\n它特别适合开发者、数据科学家及研究人员使用。无论是初学者寻找入门库，还是资深工程师对比不同语言的技术选型，都能从中获得极具价值的参考。此外，清单还延伸提供了免费书籍、在线课程、行业会议、技术博客及线下聚会等丰富资源，构建了从学习到实践的全链路支持体系。\n\n其独特亮点在于严格的维护标准：明确标记已停止维护或长期未更新的项目，确保推荐内容的时效性与可靠性。作为机器学习领域的“导航图”，awesome-machine-learning 以开源协作的方式持续更新，旨在降低技术探索门槛，让每一位从业者都能高效地站在巨人的肩膀上创新。",72149,"2026-04-03T21:50:24",[20,18],{"id":66,"github_repo":67,"name":68,"description_en":69,"description_zh":70,"ai_summary_zh":71,"readme_en":72,"readme_zh":73,"quickstart_zh":74,"use_case_zh":75,"hero_image_url":76,"owner_login":77,"owner_name":78,"owner_avatar_url":79,"owner_bio":78,"owner_company":78,"owner_location":78,"owner_email":78,"owner_twitter":78,"owner_website":78,"owner_url":80,"languages":81,"stars":112,"forks":113,"last_commit_at":114,"license":115,"difficulty_score":116,"env_os":117,"env_gpu":118,"env_ram":118,"env_deps":119,"category_tags":126,"github_topics":127,"view_count":10,"oss_zip_url":78,"oss_zip_packed_at":78,"status":22,"created_at":138,"updated_at":139,"faqs":140,"releases":179},7799,"enarjord\u002Fpassivbot","passivbot","Trading bot running on Bybit, Bitget, OKX, GateIO, Binance, Kucoin and Hyperliquid","Passivbot 是一款专为加密货币永续合约市场设计的自动化交易机器人，支持 Bybit、Binance、OKX 等主流交易所。它不依赖价格预测或技术指标，而是扮演“逆向做市商”的角色，通过自动挂单和撤单来抵抗价格波动，起到稳定市场价格的作用。\n\n该工具主要解决了用户在高频交易中难以时刻盯盘以及情绪化决策的痛点。其核心策略灵感源自马丁格尔投注法：在价格不利变动时分层加倍补仓以拉近平均成本，并在市场小幅反弹时迅速止盈离场。此外，Passivbot 还具备独特的“觅食者”（Forager）功能，能动态筛选波动率最高的市场进行交易，并拥有自动“解套”机制，通过可控的小额亏损优先处理滞留仓位，防止资金深度被套。\n\n技术层面，Passivbot 采用 Python 与 Rust 混合架构，利用 Rust 构建共享的核心调度器，确保了实盘交易与历史回测之间的高度一致性与执行速度。内置的进化算法优化器还能通过数千次回测自动迭代出最佳配置参数。\n\n由于需要配置 Rust 环境及理解复杂的交易参数，Passivbot 更适合具备一定编程基础（熟悉 Python 3.12+）的开发者、量化交易研究员或进","Passivbot 是一款专为加密货币永续合约市场设计的自动化交易机器人，支持 Bybit、Binance、OKX 等主流交易所。它不依赖价格预测或技术指标，而是扮演“逆向做市商”的角色，通过自动挂单和撤单来抵抗价格波动，起到稳定市场价格的作用。\n\n该工具主要解决了用户在高频交易中难以时刻盯盘以及情绪化决策的痛点。其核心策略灵感源自马丁格尔投注法：在价格不利变动时分层加倍补仓以拉近平均成本，并在市场小幅反弹时迅速止盈离场。此外，Passivbot 还具备独特的“觅食者”（Forager）功能，能动态筛选波动率最高的市场进行交易，并拥有自动“解套”机制，通过可控的小额亏损优先处理滞留仓位，防止资金深度被套。\n\n技术层面，Passivbot 采用 Python 与 Rust 混合架构，利用 Rust 构建共享的核心调度器，确保了实盘交易与历史回测之间的高度一致性与执行速度。内置的进化算法优化器还能通过数千次回测自动迭代出最佳配置参数。\n\n由于需要配置 Rust 环境及理解复杂的交易参数，Passivbot 更适合具备一定编程基础（熟悉 Python 3.12+）的开发者、量化交易研究员或进阶加密货币投资者使用。对于希望实现低干预、策略化自动交易的用戶而言，这是一个强大但需谨慎评估风险的专业工具。","![Passivbot](docs\u002Fimages\u002Fpbot_logo_full.svg)\n\n# Trading bot running on Bybit, OKX, Bitget, GateIO, Binance, Kucoin and Hyperliquid\n\n:warning: **Used at one's own risk** :warning:\n\n\n## Overview\n\nPassivbot is a cryptocurrency trading bot written in Python and Rust, intended to require minimal user intervention.  \n\nIt operates on perpetual futures derivatives markets, automatically creating and cancelling limit buy and sell orders on behalf of the user. It does not try to predict future price movements, it does not use technical indicators, nor does it follow trends. Rather, it is a contrarian market maker, providing resistance to price changes in both directions, thereby \"serving the market\" as a price stabilizer.  \n\nOrder planning is computed by a shared Rust orchestrator used by both live trading and backtesting for speed and consistency. Also included is an optimizer, which finds better configurations by iterating thousands of backtests with different candidates, converging on the optimal ones with an evolutionary algorithm.  \n\n## Strategy\n\nInspired by the Martingale betting strategy, the robot will make a small initial entry and double down on its losing positions multiple times to bring the average entry price closer to current price action. The orders are placed in a grid, ready to absorb sudden price movements. After each re-entry, the robot quickly updates its closing orders at a set take-profit markup. This way, if there is even a minor market reversal, or \"bounce\", the position can be closed in profit, and it starts over.  \n\n### Trailing Orders\nIn addition to grid-based entries and closes, Passivbot may be configured to utilize trailing entries and trailing closes.\n\nFor trailing entries, the bot waits for the price to move beyond a specified threshold and then retrace by a defined percentage before placing a re-entry order. Similarly, for trailing closes, the bot waits before placing its closing orders until after the price has moved favorably by a threshold percentage and then retraced by a specified percentage. This may result in the bot locking in profits more effectively by exiting positions when the market shows signs of reversing instead of at a fixed distance from average entry price.\n\nGrid and trailing orders may be combined, such that the robot enters or closes a whole or a part of the position as grid orders and\u002For as trailing orders.\n\n### Forager\nThe Forager feature dynamically chooses the most volatile markets on which to open positions. Volatility is defined as the mean of the normalized relative range for the most recent 1m candles, i.e. `mean((ohlcv.high - ohlcv.low) \u002F ohlcv.close)`.\n\n### Unstucking Mechanism\nPassivbot manages underperforming, or \"stuck\", positions by realizing small losses over time. If multiple positions are stuck, the bot prioritizes positions with the smallest gap between the entry price and current market price for \"unstucking\". Losses are limited by ensuring that the account balance does not fall under a set percentage below the past peak balance.  \n\n## Installation\n\nTo install Passivbot and its dependencies, follow the steps below.\n\nPassivbot requires **Python 3.12**. Earlier versions are not supported.\n\n### Step 1: Clone the Repository\n\nFirst, clone the Passivbot repository to the local machine:\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot.git\ncd passivbot\n```\n\n\n### Step 2: Install Rust\nPassivbot uses Rust for some of its components. Install Rust by following these steps:\n\nVisit https:\u002F\u002Fwww.rust-lang.org\u002Ftools\u002Finstall\nFollow the instructions to install Rustup, the Rust installer and version management tool.\nAfter installation, restart the terminal or command prompt.\n\n### Step 3: Create and Activate a Virtual Environment\n\nCreate a virtual environment to manage dependencies:\n\n **Linux\u002FmacOS:**\n```sh\npython3 -m venv venv\n```\n\n **Windows (Command Prompt or PowerShell):**\n```cmd\npy -3.12 -m venv venv\n```\n\nActivate the virtual environment:\n\n **Linux\u002FmacOS:**\n```sh\nsource venv\u002Fbin\u002Factivate\n```\n\n **Windows (Command Prompt):**\n```cmd\nvenv\\Scripts\\activate\n```\n\n **Windows (PowerShell):**\n```powershell\n.\\venv\\Scripts\\Activate.ps1\n```\n\n### Step 4: Install Passivbot\n\nChoose the install profile that matches your use case:\n\n- **Live-only VPS**: `python3 -m pip install -e .`\n- **Backtesting \u002F optimization \u002F research workstation**: `python3 -m pip install -e \".[full]\"`\n- **Contributing \u002F docs \u002F lint tooling**: `python3 -m pip install -e \".[dev]\"`\n\nAll profiles build the Rust extension and register the `passivbot` command.\n\nTypical live-only install:\n\n```sh\npython3 -m pip install -e .\n```\n\n### Step 5 (optional): Build Rust Extensions\n\nPassivbot will attempt to build the necessary Rust extensions automatically, but they can also be built manually by navigating to the `passivbot-rust` directory and using `maturin`:\n\n```sh\ncd passivbot-rust\nmaturin develop --release\ncd ..\n```\n\nIf changes in the Rust source are detected, recompilation is needed, which Passivbot will attempt to do automatically when starting. To manually recompile, use the commands given above.\n\n### Step 6: Add API keys\n\nMake a copy of the api-keys template file:\n\n```sh\ncp api-keys.json.example api-keys.json\n```\n\nAdd your keys to api-keys.json.\n\n### Step 7: Run Passivbot\n\n> **Hint:**  \n> To ensure cache folder names are Windows-compatible (even outside Windows), set the environment variable `WINDOWS_COMPATIBILITY=1`.   \n> This is only required in certain scenarios, e.g., running under Docker (Linux) while mounting the `caches` folder to a Windows host.\n\nTo start the bot with the default settings, run:\n\n```sh\npassivbot live -u {account_name_from_api-keys.json}\n```\n\nor make a new configuration file, using `configs\u002Fexamples\u002Fdefault_trailing_grid_long_npos10.json` as a starting point, and start the bot with:\n\n\n```sh\npassivbot live path\u002Fto\u002Fconfig.json\n```\n\nLegacy direct-script entrypoints such as `python3 src\u002Fmain.py ...`, `python3 src\u002Fbacktest.py ...`,\nand `python3 src\u002Foptimize.py ...` still work unchanged for backwards compatibility.\n\nThe canonical hardcoded defaults live in `src\u002Fconfig\u002Fschema.py`. The example config\n`configs\u002Fexamples\u002Fdefault_trailing_grid_long_npos10.json` mirrors that default profile exactly, so\ncopying it is the recommended starting point for new configs.\n\n### Logging\n\nPassivbot uses Python's logging module throughout the bot, backtester, and supporting tools.  \n- Use `--debug-level {0-3}` (alias `--log-level`) on `passivbot live` or `passivbot backtest` to adjust verbosity at runtime: `0 = warnings only`, `1 = info`, `2 = debug`, `3 = trace`.  \n- Use `--verbose` on `passivbot live` to force debug logging (`--log-level debug`).  \n- Persist a default by adding a top-level section to your config: `\"logging\": {\"level\": 2}`. The CLI flag always overrides the config value for that run.\n- `passivbot live` now writes a timestamped logfile under `logs\u002F` by default and refreshes `logs\u002F{user}.log` as a stable alias to the current run. Control this with `config.logging.persist_to_file`, `config.logging.dir`, and the optional rotation settings in `config.logging`.\n- CandlestickManager and other subsystems inherit the chosen level so EMA warm-up, data fetching, and cache behaviour can be inspected consistently.\n\n### Running Multiple Bots\n\nRunning several Passivbot instances against the same exchange on one machine is supported. Each process shares the same on-disk OHLCV cache, and the candlestick manager now uses short-lived, self-healing locks with automatic stale cleanup so that one stalled process cannot block the rest. No manual deletion of lock files is required; the bot removes stale locks on startup and logs whenever a lock acquisition times out.\n\n## Jupyter Lab\n\nJupyter lab needs to be run in the same virtual environment as the bot. Activate venv (see installation instructions above, step 3), and launch Jupyter lab from the Passivbot root dir with:\n```shell\npython3 -m jupyter lab\n```\n\n## Requirements\n\n- Python >= 3.12\n- `python3 -m pip install -e .` for live trading only\n- `python3 -m pip install -e \".[full]\"` for backtesting, optimization, downloader, and advanced tools\n- `python3 -m pip install -e \".[dev]\"` for contributor tooling on top of the full install\n\n## Pre-optimized configurations\n\nComing soon...\n\nSee also https:\u002F\u002Fpbconfigdb.scud.dedyn.io\u002F\n\n## Documentation\n\nFor more detailed information about Passivbot, see documentation files here: [docs\u002F](docs\u002F)\n\nUseful entry points:\n\n- [Installation](docs\u002Finstallation.md)\n- [Troubleshooting](docs\u002Ftroubleshooting.md)\n- [Backtesting](docs\u002Fbacktesting.md)\n- [Optimizing](docs\u002Foptimizing.md)\n- [Metrics reference](docs\u002Fmetrics.md)\n- [Equity Hard Stop Loss](docs\u002Fequity_hard_stop_loss.md)\n- [Monitor output](docs\u002Fmonitor.md)\n\n## Support\n\n[![Discord](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDiscord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https:\u002F\u002Fdiscord.gg\u002FQAF2H2UmzZ)\n\n[![Telegram](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTelegram-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white)](https:\u002F\u002Ft.me\u002Fpassivbot_futures)\n\n## Third Party Links, Referrals and Tip Jar\n\n**Hyperliquid Reference Vault**\nPassivbot's reference long-only config profile running on a Hyperliquid Vault:\nhttps:\u002F\u002Fapp.hyperliquid.xyz\u002Fvaults\u002F0x490af7d4a048a81db0f677517ed6373565b42349\n\n**Passivbot GUI**\nA graphical user interface for Passivbot:  \nhttps:\u002F\u002Fgithub.com\u002Fmsei99\u002Fpbgui\n\n**Referrals:**  \nSigning up using these referrals is appreciated:  \nhttps:\u002F\u002Faccounts.binance.com\u002Fregister?ref=TII4B07C  \nhttps:\u002F\u002Fpartner.bybit.com\u002Fb\u002Fpassivbot  \nhttps:\u002F\u002Fpartner.bitget.com\u002Fbg\u002FY8FU1W  \nhttps:\u002F\u002Fwww.okx.com\u002Fjoin\u002FPASSIVBOT  \nhttps:\u002F\u002Fapp.hyperliquid.xyz\u002Fjoin\u002FPASSIVBOT  \nhttps:\u002F\u002Fwww.kucoin.com\u002Fr\u002Fbroker\u002FCX8QZQJX  \n\n**Note on Binance**  \nTo support continued Passivbot development, please use a Binance account which  \n1) was created after 2024-09-21 and  \n2) either:  \n  a) was created without a referral link, or  \n  b) was created with referral ID: \"TII4B07C\".  \n                                                                                      \nPassivbot receives commissions from trades only for accounts meeting these criteria.  \n\n\n**BuyMeACoffee:**  \nhttps:\u002F\u002Fwww.buymeacoffee.com\u002Fenarjord  \n\n**Donations:**  \nIf the robot is profitable, consider donating as showing gratitude for its development:  \n\n- USDT or USDC Binance Smart Chain BEP20:  \n0x4b7b5bf6bea228052b775c052843fde1c63ec530  \n- USDT or USDC Arbitrum One:  \n0x4b7b5bf6bea228052b775c052843fde1c63ec530  \n- Zcash (ZEC):  \nu1jlans93rrqusqx2wp5020aezyt0q22l4tuy7ezkna06fuyaa2gxzremf50wsj3k83a4cm0cncs6zt9urlpte7a3nzvq992z48jxzem455acmhmhhwfwjcjwl8z79vlznla0r3jln6ety565254h96whnllcmepmpqu3ft9hxtqvkn0m7  \n\nBitcoin (BTC) via Strike:  \nenarjord@strike.me\n\n## License\nThis is free and unencumbered software released into the public domain.\n\nAnyone is free to copy, modify, publish, use, compile, sell, or\ndistribute this software, either in source code form or as a compiled\nbinary, for any purpose, commercial or non-commercial, and by any\nmeans.\n\nIn jurisdictions that recognize copyright laws, the author or authors\nof this software dedicate any and all copyright interest in the\nsoftware to the public domain. We make this dedication for the benefit\nof the public at large and to the detriment of our heirs and\nsuccessors. We intend this dedication to be an overt act of\nrelinquishment in perpetuity of all present and future rights to this\nsoftware under copyright law.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\nFor more information, please refer to \u003Chttps:\u002F\u002Funlicense.org\u002F>\n","![Passivbot](docs\u002Fimages\u002Fpbot_logo_full.svg)\n\n# 在 Bybit、OKX、Bitget、GateIO、Binance、Kucoin 和 Hyperliquid 上运行的交易机器人\n\n:warning: **请自行承担风险使用** :warning:\n\n## 概述\n\nPassivbot 是一款用 Python 和 Rust 编写的加密货币交易机器人，旨在尽量减少用户干预。  \n\n它在永续期货衍生品市场上运行，代表用户自动创建和取消限价买入与卖出订单。它不试图预测未来的价格走势，也不使用技术指标或跟随趋势。相反，它是一种逆向做市商，在两个方向上为价格变化提供阻力，从而作为价格稳定器“服务于市场”。  \n\n订单计划由一个共享的 Rust 协调器计算，该协调器同时用于实盘交易和回测，以确保速度和一致性。此外，还包含一个优化器，它通过迭代数千次不同候选配置的回测来寻找更好的设置，并利用进化算法收敛到最优配置。\n\n## 策略\n\n受马丁格尔投注策略启发，机器人会进行小额初始建仓，并在亏损时多次加倍加仓，使平均入场价更接近当前价格走势。订单以网格形式排列，随时准备吸收突发的价格波动。每次重新入场后，机器人会迅速根据设定的止盈幅度更新平仓订单。这样一来，即使市场出现小幅反转或“反弹”，也能获利了结，并重新开始新一轮操作。\n\n### 尾随订单\n除了基于网格的开仓和平仓外，Passivbot 还可以配置为使用尾随开仓和尾随平仓。\n\n对于尾随开仓，机器人会等待价格突破指定阈值，然后回撤一定比例后再下达重新入场订单。同样地，对于尾随平仓，机器人会在价格朝着有利方向移动达到阈值后，再回撤一定比例才下达平仓订单。这种方式可以让机器人在市场出现反转迹象时更有效地锁定利润，而不是按照与平均入场价固定的距离来平仓。\n\n网格订单和尾随订单可以结合使用，即机器人可以根据需要以网格订单和\u002F或尾随订单的形式开仓或平仓部分仓位。\n\n### 寻觅者\n“寻觅者”功能会动态选择波动性最大的市场来开仓。波动性定义为最近 1 分钟蜡烛图的归一化相对波幅的平均值，即 `mean((ohlcv.high - ohlcv.low) \u002F ohlcv.close)`。\n\n### 解困机制\nPassivbot 通过逐步实现小幅亏损来管理表现不佳或“卡住”的仓位。如果有多笔仓位处于卡住状态，机器人会优先处理入场价与当前市场价格差距最小的仓位进行解困。同时，为了限制损失，账户余额不会低于历史最高余额的某个百分比。\n\n## 安装\n\n要安装 Passivbot 及其依赖项，请按照以下步骤操作。\n\nPassivbot 需要 **Python 3.12**。较早版本不受支持。\n\n### 第一步：克隆仓库\n\n首先，将 Passivbot 仓库克隆到本地机器：\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot.git\ncd passivbot\n```\n\n### 第二步：安装 Rust\nPassivbot 的部分组件使用 Rust。请按照以下步骤安装 Rust：\n\n访问 https:\u002F\u002Fwww.rust-lang.org\u002Ftools\u002Finstall\n按照说明安装 Rustup，即 Rust 的安装和版本管理工具。\n安装完成后，请重启终端或命令提示符。\n\n### 第三步：创建并激活虚拟环境\n\n创建一个虚拟环境来管理依赖项：\n\n**Linux\u002FmacOS：**\n```sh\npython3 -m venv venv\n```\n\n**Windows（命令提示符或 PowerShell）：**\n```cmd\npy -3.12 -m venv venv\n```\n\n激活虚拟环境：\n\n**Linux\u002FmacOS：**\n```sh\nsource venv\u002Fbin\u002Factivate\n```\n\n**Windows（命令提示符）：**\n```cmd\nvenv\\Scripts\\activate\n```\n\n**Windows（PowerShell）：**\n```powershell\n.\\venv\\Scripts\\Activate.ps1\n```\n\n### 第四步：安装 Passivbot\n\n根据您的使用场景选择合适的安装配置：\n\n- **仅用于实盘的 VPS**：`python3 -m pip install -e .`\n- **用于回测\u002F优化\u002F研究的工作站**：`python3 -m pip install -e \".[full]\"`\n- **用于贡献代码\u002F文档\u002F代码检查工具**：`python3 -m pip install -e \".[dev]\"`\n\n所有配置都会构建 Rust 扩展，并注册 `passivbot` 命令。\n\n典型的仅用于实盘的安装：\n\n```sh\npython3 -m pip install -e .\n```\n\n### 第五步（可选）：手动构建 Rust 扩展\nPassivbot 会尝试自动构建所需的 Rust 扩展，但您也可以手动进入 `passivbot-rust` 目录并使用 `maturin` 工具进行构建：\n\n```sh\ncd passivbot-rust\nmaturin develop --release\ncd ..\n```\n\n如果检测到 Rust 源代码有更改，则需要重新编译，Passivbot 在启动时会尝试自动完成此操作。如需手动重新编译，可使用上述命令。\n\n### 第六步：添加 API 密钥\n\n复制 API 密钥模板文件：\n\n```sh\ncp api-keys.json.example api-keys.json\n```\n\n将您的密钥添加到 `api-keys.json` 文件中。\n\n### 第七步：运行 Passivbot\n\n> **提示：**  \n> 为确保缓存文件夹名称在 Windows 系统下兼容（即使不在 Windows 系统中），请设置环境变量 `WINDOWS_COMPATIBILITY=1`。  \n> 此设置仅在特定情况下需要，例如在 Docker（Linux）环境中运行，并将 `caches` 文件夹挂载到 Windows 主机时。\n\n要使用默认设置启动机器人，请运行：\n\n```sh\npassivbot live -u {account_name_from_api-keys.json}\n```\n\n或者，您可以基于 `configs\u002Fexamples\u002Fdefault_trailing_grid_long_npos10.json` 创建一个新的配置文件，然后使用以下命令启动机器人：\n\n```sh\npassivbot live path\u002Fto\u002Fconfig.json\n```\n\n为了保持向后兼容性，旧版直接脚本入口点，如 `python3 src\u002Fmain.py ...`、`python3 src\u002Fbacktest.py ...` 和 `python3 src\u002Foptimize.py ...` 仍然可用且无需更改。\n\n标准的硬编码默认配置位于 `src\u002Fconfig\u002Fschema.py` 中。示例配置文件 `configs\u002Fexamples\u002Fdefault_trailing_grid_long_npos10.json` 完全反映了该默认配置，因此建议新用户以此文件作为起点来创建自己的配置文件。\n\n### 日志记录\n\nPassivbot 在整个机器人、回测工具及辅助工具中均使用了 Python 的 logging 模块。  \n- 在 `passivbot live` 或 `passivbot backtest` 中使用 `--debug-level {0-3}`（别名 `--log-level`）来调整运行时的日志详细程度：`0 = 仅显示警告`，`1 = 信息`，`2 = 调试`，`3 = 追踪`。  \n- 在 `passivbot live` 中使用 `--verbose` 可强制启用调试日志记录（`--log-level debug`）。  \n- 通过在配置文件的顶层添加 `\"logging\": {\"level\": 2}` 来设置默认的日志级别。CLI 标志始终会覆盖该次运行的配置值。\n- `passivbot live` 现在默认会在 `logs\u002F` 目录下写入带时间戳的日志文件，并刷新 `logs\u002F{user}.log` 作为当前运行的稳定别名。可通过 `config.logging.persist_to_file`、`config.logging.dir` 以及 `config.logging` 中的可选轮转设置来控制此行为。\n- K 线管理器及其他子系统会继承所选的日志级别，以便一致地检查 EMA 预热、数据获取和缓存行为。\n\n### 运行多个机器人\n\n支持在同一台机器上对同一交易所运行多个 Passivbot 实例。每个进程共享相同的磁盘 OHLCV 缓存，而 K 线管理器现在使用短生命周期、可自我修复的锁机制，并具备自动清理过期锁的功能，从而避免某个进程卡死导致其他进程被阻塞。无需手动删除锁文件；机器人会在启动时移除过期的锁，并在锁获取超时时记录日志。\n\n## Jupyter Lab\n\nJupyter Lab 需要在与机器人相同的虚拟环境中运行。激活虚拟环境（参见上述安装步骤第 3 步），然后从 Passivbot 的根目录启动 Jupyter Lab：\n```shell\npython3 -m jupyter lab\n```\n\n## 系统要求\n\n- Python >= 3.12\n- 仅进行实盘交易时需运行：`python3 -m pip install -e .`\n- 进行回测、优化、数据下载及使用高级工具时需运行：`python3 -m pip install -e \".[full]\"`\n- 对于贡献者工具，则需运行：`python3 -m pip install -e \".[dev]\"`，在此基础上完成全量安装。\n\n## 预优化配置\n\n即将推出……\n\n更多信息请参阅：https:\u002F\u002Fpbconfigdb.scud.dedyn.io\u002F\n\n## 文档\n\n有关 Passivbot 的更详细信息，请参阅此处的文档文件：[docs\u002F](docs\u002F)\n\n常用入口：\n\n- [安装指南](docs\u002Finstallation.md)\n- [故障排除](docs\u002Ftroubleshooting.md)\n- [回测](docs\u002Fbacktesting.md)\n- [优化](docs\u002Foptimizing.md)\n- [指标参考](docs\u002Fmetrics.md)\n- [权益硬止损](docs\u002Fequity_hard_stop_loss.md)\n- [监控输出](docs\u002Fmonitor.md)\n\n## 支持\n\n[![Discord](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDiscord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https:\u002F\u002Fdiscord.gg\u002FQAF2H2UmzZ)\n\n[![Telegram](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTelegram-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white)](https:\u002F\u002Ft.me\u002Fpassivbot_futures)\n\n## 第三方链接、推荐及打赏\n\n**Hyperliquid 推荐金库**  \nPassivbot 的长期多头策略配置，在 Hyperliquid 金库中运行：\nhttps:\u002F\u002Fapp.hyperliquid.xyz\u002Fvaults\u002F0x490af7d4a048a81db0f677517ed6373565b42349\n\n**Passivbot GUI**  \nPassivbot 的图形用户界面：\nhttps:\u002F\u002Fgithub.com\u002Fmsei99\u002Fpbgui\n\n**推荐链接：**  \n欢迎通过以下推荐链接注册账户以示支持：\nhttps:\u002F\u002Faccounts.binance.com\u002Fregister?ref=TII4B07C  \nhttps:\u002F\u002Fpartner.bybit.com\u002Fb\u002Fpassivbot  \nhttps:\u002F\u002Fpartner.bitget.com\u002Fbg\u002FY8FU1W  \nhttps:\u002F\u002Fwww.okx.com\u002Fjoin\u002FPASSIVBOT  \nhttps:\u002F\u002Fapp.hyperliquid.xyz\u002Fjoin\u002FPASSIVBOT  \nhttps:\u002F\u002Fwww.kucoin.com\u002Fr\u002Fbroker\u002FCX8QZQJX  \n\n**关于 Binance 的说明**  \n为支持 Passivbot 的持续开发，请使用符合以下条件的 Binance 账户：  \n1) 账户创建日期晚于 2024 年 9 月 21 日；  \n2) 账户要么未通过推荐链接创建，要么使用推荐 ID：“TII4B07C”。  \n仅满足上述条件的账户所产生的交易佣金才会归 Passivbot 所有。\n\n\n**BuyMeACoffee：**  \nhttps:\u002F\u002Fwww.buymeacoffee.com\u002Fenarjord  \n\n**捐赠：**  \n若机器人为您带来收益，请考虑捐赠以表达对开发工作的感谢：  \n\n- USDT 或 USDC Binance Smart Chain BEP20：  \n0x4b7b5bf6bea228052b775c052843fde1c63ec530  \n- USDT 或 USDC Arbitrum One：  \n0x4b7b5bf6bea228052b775c052843fde1c63ec530  \n- Zcash (ZEC)：  \nu1jlans93rrqusqx2wp5020aezyt0q22l4tuy7ezkna06fuyaa2gxzremf50wsj3k83a4cm0cncs6zt9urlpte7a3nzvq992z48jxzem455acmhmhhwfwjcjwl8z79vlznla0r3jln6ety565254h96whnllcmepmpqu3ft9hxtqvkn0m7  \n\n比特币 (BTC) 可通过 Strike 支付：  \nenarjord@strike.me\n\n## 许可证\n本软件为自由且无约束的开源软件，已发布至公共领域。\n\n任何人均可出于任何目的（无论是商业用途还是非商业用途），以源代码形式或编译后的二进制文件形式复制、修改、发布、使用、编译、销售或分发本软件，不受任何限制。\n\n在承认版权法的司法管辖区，本软件的作者特此将其对本软件的所有版权利益永久性地转让给公众。我们作出此项声明，旨在使广大公众受益，同时放弃我们自身及其继承人和继任者的任何权利。我们希望这一声明能够明确表示，我们将永久性地放弃本软件在未来任何时候根据版权法所享有的所有权利。\n\n本软件按“原样”提供，不提供任何形式的明示或暗示担保，包括但不限于适销性、特定用途适用性和非侵权性。在任何情况下，作者均不对因本软件或其使用而产生的任何索赔、损害或其他责任负责，无论此类责任是基于合同、侵权行为或其他原因。\n\n如需更多信息，请参阅 \u003Chttps:\u002F\u002Funlicense.org\u002F>","# Passivbot 快速上手指南\n\nPassivbot 是一款基于 Python 和 Rust 开发的加密货币永续合约交易机器人，支持 Bybit、OKX、Bitget、GateIO、Binance、Kucoin 和 Hyperliquid 等交易所。它采用逆势做市策略，不预测价格趋势，而是通过网格挂单和马丁格尔加仓机制提供流动性并稳定价格。\n\n> ⚠️ **风险提示**：本工具涉及真实资金交易，请自行承担风险。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n- **操作系统**：Linux、macOS 或 Windows\n- **Python 版本**：必须为 **Python 3.12**（不支持更低版本）\n- **Rust 环境**：需安装 Rust 工具链（用于构建高性能核心组件）\n- **网络环境**：需能正常访问 GitHub 及对应交易所 API\n\n### 前置依赖安装\n\n1. **安装 Rust**\n   访问 [https:\u002F\u002Fwww.rust-lang.org\u002Ftools\u002Finstall](https:\u002F\u002Fwww.rust-lang.org\u002Ftools\u002Finstall) 下载并运行安装脚本。安装完成后重启终端。\n\n2. **验证 Python 版本**\n   ```sh\n   python3 --version\n   # 必须输出 Python 3.12.x\n   ```\n\n## 安装步骤\n\n### 1. 克隆项目代码\n将 Passivbot 仓库克隆到本地：\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot.git\ncd passivbot\n```\n> 💡 **国内加速建议**：如果克隆速度慢，可使用镜像源：\n> ```sh\n> git clone https:\u002F\u002Fgitee.com\u002Fmirrors\u002Fpassivbot.git\n> ```\n> *(注：若 Gitee 无同步镜像，请配置本地 Git 代理或使用上述官方源)*\n\n### 2. 创建虚拟环境\n为避免依赖冲突，强烈建议使用虚拟环境。\n\n**Linux\u002FmacOS:**\n```sh\npython3 -m venv venv\nsource venv\u002Fbin\u002Factivate\n```\n\n**Windows (CMD\u002FPowerShell):**\n```cmd\npy -3.12 -m venv venv\nvenv\\Scripts\\activate\n```\n\n### 3. 安装 Passivbot\n根据使用场景选择安装模式。对于大多数实盘用户，仅需基础模式：\n\n```sh\npython3 -m pip install -e .\n```\n\n> **其他模式参考**：\n> - 回测与优化专用：`python3 -m pip install -e \".[full]\"`\n> - 开发者贡献模式：`python3 -m pip install -e \".[dev]\"`\n\n*安装过程中会自动编译 Rust 扩展模块，请保持网络连接畅通。*\n\n### 4. 配置 API 密钥\n复制配置文件模板并填入您的交易所 API 信息：\n\n```sh\ncp api-keys.json.example api-keys.json\n```\n使用文本编辑器打开 `api-keys.json`，按照格式填入各交易所的 `key` 和 `secret`。\n\n## 基本使用\n\n### 启动实盘机器人\n使用默认配置启动机器人（替换 `{account_name}` 为您在 `api-keys.json` 中定义的账户名称）：\n\n```sh\npassivbot live -u {account_name}\n```\n\n### 使用自定义配置启动\n您可以复制示例配置文件进行修改，然后指定路径启动：\n\n```sh\n# 复制示例配置（网格 + 追踪订单策略）\ncp configs\u002Fexamples\u002Fdefault_trailing_grid_long_npos10.json my_config.json\n\n# 编辑 my_config.json 调整参数后启动\npassivbot live my_config.json\n```\n\n### 日志与调试\n- 默认日志保存在 `logs\u002F` 目录下。\n- 如需查看更详细的调试信息，可添加参数：\n  ```sh\n  passivbot live my_config.json --log-level 2\n  ```\n- 若需在 Windows 兼容模式下运行（如 Docker 挂载卷场景），可设置环境变量：\n  ```sh\n  export WINDOWS_COMPATIBILITY=1\n  ```\n\n现在，Passivbot 已开始根据您的配置在选定市场上自动执行交易策略。请密切监控初始运行情况。","一位拥有少量资金的加密货币交易者希望在 Bybit 和 Binance 的永续合约市场中，通过自动化手段在震荡行情里获取稳定收益，同时避免时刻盯盘。\n\n### 没有 passivbot 时\n- **情绪化操作严重**：面对价格剧烈波动，交易者容易因恐惧过早平仓或因贪婪拒绝止损，导致“追涨杀跌”。\n- **网格管理繁琐**：手动设置多层限价单不仅耗时，且难以在价格快速穿梭时及时撤单和重新挂单，错失反弹获利机会。\n- **资金利用率低**：无法同时监控多个高波动币种，往往死守一两个交易对，错过了其他市场的套利空间。\n- **被套牢无对策**：当行情单边下跌导致仓位被套时，缺乏科学的“解套”机制，只能被动等待或盲目补仓加剧风险。\n\n### 使用 passivbot 后\n- **严格执行逆势策略**：passivbot 基于马丁格尔策略自动在下跌中分批加倍买入，拉低均价，并在微小反弹时立即止盈，完全剔除人为情绪干扰。\n- **动态订单维护**：利用 Rust 构建的高速协调器，passivbot 毫秒级响应市场变化，自动完成网格挂单、撤单及追踪止盈，确保始终处于最佳挂单位置。\n- **智能优选市场**：启用\"Forager\"功能后，passivbot 自动扫描并优先交易波动率最高的币种，最大化资金在单位时间内的产出效率。\n- **自动化解套风控**：触发“解套机制”时，passivbot 会优先处理亏损最小的仓位，通过实现小额亏损逐步释放保证金，防止账户因深度套牢而爆仓。\n\npassivbot 将复杂的做市商策略转化为无人值守的自动化流程，让交易者在无需预测行情的情况下，依靠市场波动本身实现稳健增值。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fenarjord_passivbot_3fdf7a84.png","enarjord",null,"https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fenarjord_893a8a2c.png","https:\u002F\u002Fgithub.com\u002Fenarjord",[82,86,90,94,98,101,105,108],{"name":83,"color":84,"percentage":85},"Python","#3572A5",84.6,{"name":87,"color":88,"percentage":89},"Rust","#dea584",14.2,{"name":91,"color":92,"percentage":93},"JavaScript","#f1e05a",0.7,{"name":95,"color":96,"percentage":97},"Jupyter Notebook","#DA5B0B",0.2,{"name":99,"color":100,"percentage":97},"CSS","#663399",{"name":102,"color":103,"percentage":104},"Shell","#89e051",0.1,{"name":106,"color":107,"percentage":104},"HTML","#e34c26",{"name":109,"color":110,"percentage":111},"Dockerfile","#384d54",0,1937,645,"2026-04-15T09:26:37","Unlicense",4,"Linux, macOS, Windows","未说明",{"notes":120,"python":121,"dependencies":122},"该工具由 Python 和 Rust 混合编写，必须安装 Rust 环境。支持在 Linux、macOS 和 Windows 上运行，但在 Windows 下运行 Docker 挂载缓存时建议设置环境变量 WINDOWS_COMPATIBILITY=1。安装分为仅实盘交易、回测\u002F优化\u002F研究、以及开发贡献三种模式，需根据需求选择对应的 pip 安装参数。策略基于网格和马丁格尔原理，不涉及深度学习，因此无特定 GPU 或大内存需求，具体资源消耗取决于同时运行的交易对数量和回测规模。","3.12",[123,124,125],"Rust (通过 Rustup 安装)","maturin (用于构建 Rust 扩展)","jupyterlab (可选，用于研究)",[18],[128,129,130,131,132,133,134,135,136,137],"bybit","futures","trading","algorithmic-trading","bitget","okx","gateio","hyperliquid","perpetual-futures","binance","2026-03-27T02:49:30.150509","2026-04-16T02:02:37.176967",[141,146,151,155,160,165,169,174],{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},34929,"是否支持 Ray Tune 集群分布式调参？","目前官方尚未支持在多节点集群上运行 Passivbot 配合 Ray Tune 进行分布式超参数优化。虽然该功能未来可能被考虑添加，但现阶段仅支持单机运行。如有足够用户需求，可能会作为后续特性开发。","https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fissues\u002F122",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},34928,"最小启动资金需要多少才能承受回撤？","最小资金取决于交易所的最小合约规模限制及所用参数设置。用户可在回测器中定义 \"starting_balance\" 进行模拟测试，根据历史极端行情（如暴涨暴跌）验证当前参数下的抗风险能力，从而确定适合自身策略的最低资金门槛。","https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fissues\u002F12",{"id":152,"question_zh":153,"answer_zh":154,"source_url":150},34923,"机器人如何处理单边行情？如果价格一直朝一个方向走不回头怎么办？","这是一个关键问题。该机器人在震荡行情中表现最佳，但如果价格长时间单边移动，最终会导致爆仓。回测可以揭示能够应对过去暴涨暴跌的参数设置。机器人仅在盈利时减少仓位，除非触发“软止损”（soft stop）。对于多头仓位，重新入场买入价总是低于持仓价，平仓卖出价总是高于持仓价；空头仓位则相反。",{"id":156,"question_zh":157,"answer_zh":158,"source_url":159},34924,"机器人的实时收益表现如何？是否稳定盈利？","在实盘中，根据使用的参数和市场条件，机器人平均每天收益在 4% 到 15% 之间。有时一天可超过 20%，有时则较慢仅 2%。但请注意：早期版本曾因参数测试不足、代码漏洞或不安全算法导致爆仓归零。此外，2024 年 6 月 5 日更新指出，此类高收益不可持续，中长期几乎必然面临爆仓风险，需格外谨慎。","https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fissues\u002F7",{"id":161,"question_zh":162,"answer_zh":163,"source_url":164},34925,"如何实现止损功能？","已在 dynamic_grid 分支中实现“软止损”（soft stop loss）功能。默认情况下，当最新价格与强平价格的差额小于 2% 时，机器人将以 2% 的亏损主动减仓。目前该功能仅在 Bybit 交易所可用，Binance 尚未完全移植支持。","https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fissues\u002F4",{"id":166,"question_zh":167,"answer_zh":168,"source_url":150},34926,"遇到错误 \"code: -2011, msg: Unknown order sent.\" 或 \"code: -1021, Timestamp outside recvWindow\" 怎么办？","这些错误通常由时间戳不同步或请求频率过高引起。对于 -1021 错误，请确保系统时间与交易所服务器时间同步（建议使用 NTP）。对于 -2011 错误，可能是订单已被取消或不存在，建议检查订单状态后再重试取消操作。若频繁出现 418 错误（IP 被禁），应改用 WebSocket 获取实时数据以避免速率限制，并在异步代码结束时显式调用 exchange.close() 释放资源。",{"id":170,"question_zh":171,"answer_zh":172,"source_url":173},34927,"运行时报错 \"AttributeError: 'NoneType' object has no attribute 'exit'\" 如何解决？","此错误发生在初始化 Telegram 通知模块时。维护者已确认该问题并通过 PR #81 修复。请拉取最新代码或等待合并后更新即可解决。临时方案可禁用 Telegram 通知功能。","https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fissues\u002F83",{"id":175,"question_zh":176,"answer_zh":177,"source_url":178},34930,"Bybit USDT 永续合约无法交易怎么办？","Bybit 已停用部分 REST 和 WebSocket API 端点，可能导致机器人无法正常交易。建议检查 exchanges\u002Fbybit.py 文件中的接口调用是否匹配当前官方文档，并参考 Hummingbot 相关 issue（#6585）了解迁移方案。同时可考虑增加“最后交易时间过久”的重连机制以增强鲁棒性。","https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fissues\u002F420",[180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,255,260,265,270,275],{"id":181,"version":182,"summary_zh":183,"released_at":184},272238,"v7.9.1","# v7.9.1 版本发布说明\n\n本说明描述了从 `v7.9.0` 到 `v7.9.1` 的面向用户的变化。\n\n## 亮点\n- 回测和实盘现在共享更清晰的 `pnls_max_lookback_days` 协议，包括对 `\"all\"` 的支持、正确的滚动窗口行为，以及恢复的 `backtest.visible_metrics` 过滤功能。\n- Hyperliquid HIP-3 实盘支持更加稳健：启动和稳态发现问题已修复，仓位规模与隐藏储备\u002F保证金已对齐，并且专门的探测工具现已发布。\n- 配置和 CLI 行为更加严格和清晰：引入模式标记的配置文件、实盘专属的共享执行设置、回测\u002F优化 CLI 上暴露的继承自实盘运行时标志、点分隔覆盖修复，以及对无效 `unstuck_ema_dist` 的显式验证失败机制。\n- 实盘运行时行为在操作稳定性上有所提升：Bybit 成交历史风暴现象减少，Binance 交易历史分页问题已修复，交易所感知的 EMA 节奏控制和每小时抖动机制减少了 API 突发请求，且实盘运行默认归档日志。\n- 容器\u002F运行时及工具链支持显著增强：规范化的实盘容器契约、基于环境变量的配置渲染、更合理的 HLCV 缓存命名、更丰富的 Pareto 工具集、下载器 CLI 的清理优化，以及全新的 Hyperliquid 诊断工具。\n\n## 升级注意事项\n- 升级后请重新安装：\n  `python3 -m pip install -e .`\n  或\n  `python3 -m pip install -e \".[full]\"`\n- 如果 Rust 扩展看起来过时，请在当前环境中重新构建：\n  `maturin develop --release`\n- `config.backtest.market_orders_allowed`、`config.backtest.market_order_near_touch_threshold` 和 `config.backtest.pnls_max_lookback_days` 已不再被接受。请将这些配置项移至 `config.live` 下。\n- `live.pnls_max_lookback_days` 现在在实盘、HSL、绘图和回测中使用统一的协议：\n  - `0` = 最小的有效原生回溯期\n  - 正浮点数 = 滚动 N 天窗口\n  - `\"all\"` = 全部可用历史数据\n- 无效的 `unstuck_ema_dist` 边界值现在会在配置验证阶段直接报错：\n  - `bot.long.unstuck_ema_dist` 必须大于 `-1.0`\n  - `bot.short.unstuck_ema_dist` 必须小于 `1.0`\n- 旧版的 `python src\u002Fdownloader.py ...` 入口点已被移除。请改用 `passivbot download ...`。\n\n## 变更内容\n\n### 配置、CLI 和运行时协议\n- 从 `v7.9.0` 开始，新增正式的顶级 `config_version` 模式标记，提供规范的默认值，并在示例配置中同步记录模式版本；加载时会自动迁移旧版本配置。\n- 共享的实盘\u002F回测执行设置现仅位于 `config.live` 下，以避免运行时与回测行为之间的隐性差异。\n- 继承自 `live.*` 字段的 CLI\u002F运行时所有权现为显式，因此 `backtest` 和 `optimize` 的帮助信息及预期配置会正确显示继承的运行时标志。\n- 点分隔的 CLI 覆盖现在会自动创建缺失的中间配置部分，而不再在原始配置遗漏时静默失败。\n- `live.approved_coins` 和 `live.ignored_coins` 现在采用规范的结构，明确支持每侧的 `\"all\"` 选项，以及 leg","2026-04-13T15:53:36",{"id":186,"version":187,"summary_zh":188,"released_at":189},272239,"v7.9.0","# v7.9.0 版本发布说明\n\n本说明描述了从 `master` 分支到 `v7.9.0` 版本的用户可见变更。\n\n## 亮点\n- 股票硬止损现已成为完整的实盘与回测功能，由 Rust 独立运行时负责处理，提供更丰富的指标，并支持确定性的假实盘回放测试。\n- 优化模块现已原生支持 `pymoo` 作为后端，并将其设为默认配置；同时引入显式的目标函数定义及实盘 NSGA-II\u002FNSGA-III 配置。\n- 新增 `passivbot tool pareto` 探索器，便于用户从本地优化结果中查看并选择帕累托最优解。\n- 配置加载现通过标准化的分阶段流程执行，包含代码内默认模式、旧版配置项的兼容性迁移，以及新的标准示例配置路径。\n- Passivbot 现在提供统一的 `passivbot` 命令行工具，具有更清晰的默认帮助信息、安装配置分离、更强的环境不匹配检测能力，以及更严格的 Rust 版本检查机制。\n- 内置监控堆栈现已可用：包括消息发布者、中继服务、浏览器仪表板、TUI 界面及辅助封装工具。\n\n## 升级注意事项\n- 升级后请重新安装：\n  `python3 -m pip install -e .`\n  或\n  `python3 -m pip install -e \".[full]\"`\n- 若发现 Rust 版本过旧或使用了错误的二进制文件，请运行：\n  `maturin develop --release`\n- `optimize.backend` 现已默认设置为 `pymoo`，因此使用优化功能的用户需采用完整安装配置以获取新依赖。\n- `configs\u002Ftemplate.json` 不再是官方推荐的初始配置文件。请改用 `configs\u002Fexamples\u002Fdefault_trailing_grid_long_npos10.json`，或直接省略配置路径以使用默认模式。\n- 官方模式默认启用本地监控功能。如无需在本地生成快照和事件文件，可将 `monitor.enabled = false`。\n- `live.max_realized_loss_pct` 现已默认值为 `1.0`，因此实现亏损闸门功能需手动开启，除非您明确设置了更低的阈值。\n\n## 新特性\n\n### 股票硬止损\n- 在实盘和回测中新增账户级别的股票硬止损框架，由 Rust 管理回撤状态、分层跟踪、RED 锁定、冷却期重启逻辑及不可重启处理机制。\n- 增加了更丰富的 HSL 指标与图表，包括按年度统计的触发与重启次数、时间占比指标、暂停与重启指标、恐慌平仓指标，以及 `hard_stop_drawdown.png` 图表。\n- 提供确定性的假实盘回放工具及多种场景，以便在本地测试 RED 暂停、冷却行为、人工干预及重启策略。\n- 明确了 HSL 的语义，包括不可重启阈值的限制、子区间 EMA 的降级处理，以及市场恐慌时的执行逻辑。\n\n### 优化与帕累托工具\n- 在 DEAP 之外新增 `pymoo` 后端，并将其设为默认优化引擎。\n- 实现对嵌套 `optimize.pymoo.*` 设置的真实运行时支持，包括算法类型、共享的交叉与变异参数，以及 NSGA-III 的参考方向配置。\n- 优化评分方式改为显式的 `{指标, 目标}` 规范，取代隐式的符号权重，同时保持对旧版字符串列表配置的兼容性。\n- 增加自动调整…","2026-04-04T17:53:59",{"id":191,"version":192,"summary_zh":193,"released_at":194},272240,"v7.8.4","## 变更\n\n- **双重余额路由（原始余额 vs 滞后截断余额）** - 现行交易和编排器流程同时携带 `balance_raw`（原始钱包余额）和 `balance`（滞后截断后的余额）。规模调整\u002F订单形态路径使用截断后的余额，而风险与会计路径则使用原始余额（包括已实现亏损门限的峰值\u002F底值检查、TWEL 入场\u002F自动减仓门控，以及自动解除卡单额度计算）。这一规则通过 Rust 编排器输入，在现行交易和回测中保持一致。\n- **WEL 分母行为按模式分离** - 现行交易现对每只标的的 WEL 使用硬性固定分母（`total_wallet_exposure_limit \u002F config.bot.{pside}.n_positions`），从而消除了因持仓数量变化导致的运行时分母漂移。回测现新增 `backtest.dynamic_wel_by_tradability` 配置项（默认为 `true`）：启用时，WEL 会根据具有真实 K 线的币种动态调整分母（取 `n_positions` 和 `n_tradable_max` 中的较小值），且在下架后不会缩小；禁用时，回测将沿用与现行交易相同的固定分母。\n- **Hyperliquid 批量行情获取** - `calc_ideal_orders` 现在仅需一次 `allMids` API 调用即可获取所有标的的价格，而非针对每个标的单独调用 `get_current_close`（1 次调用 vs 约 70 次）。若为非 Hyperliquid 交易所或发生错误，则回退至逐个标的获取。\n- **Hyperliquid 的顺序保证金模式设置** - 保证金模式和杠杆的 API 调用现改为按顺序执行，并加入少量延时，而非并行发起，以减少换币时的 API 爆发。\n\n## 修复\n\n- **Bybit 填单事件数量在重复页面中的膨胀问题** - `BybitFetcher` 现在会在规范化\u002F合并之前，先按执行 ID 对 `fetch_my_trades` 行进行去重，防止重复分页行导致规范化的 `qty`、`fees` 和收盘盈亏被虚增。\n- **滞后机制下余额峰值朝错误方向漂移** - 峰值重建公式（`balance + (pnl_cumsum_max - pnl_cumsum_last)`）在某些路径中曾使用滞后截断后的余额。由于截断后的余额可能保持不变，而 `pnl_cumsum_last` 却随每笔成交不断更新，这会导致盈利后重建峰值向下漂移，亏损后则向上漂移。现对峰值和盈亏准确性敏感的路径统一改用原始余额（`balance_raw`）。\n- **Pytest 中 Rust 模块的引导回退机制** - 测试引导程序现在会优先尝试项目虚拟环境中的 `passivbot_rust` 包，若未找到再回退到轻量级存根模块，从而避免在虚拟环境外运行测试时因 Rust 模块解析缺失或错误而导致的误报失败。\n- **当持仓槽位未满时，`max_ohlcv_fetches_per_minute` 被忽略** - 此速率限制配置仅在所有仓位槽位均已满时才会生效。而在有空闲槽位的情况下（常见情形），所有候选标的都会被无限制地批量获取，进而导致 Hyperliquid 上出现 429 错误。\n- **Hyperliquid 的仓位与余额重复获取问题** - `fetch_positions` 和 `fetch_balance` 现在通过去重锁共享一次 API 调用，而非在每个执行周期内发出两次完全相同的 `clearinghouseState` 请求。\n- **分钟边界处的惊群现象**","2026-03-06T16:28:14",{"id":196,"version":197,"summary_zh":198,"released_at":199},272241,"v7.8.3","## 新增\n- 新增 `live.max_realized_loss_pct` 配置项（默认值为 `0.05`），用于阻止执行会导致亏损超过峰值余额相对阈值的平仓订单。该功能适用于正常平仓、WEL\u002FTWEL 自动减仓以及解冻平仓；恐慌平仓仍不受此限制。\n\n## 修复\n- 修复了在完全相同的重新构建后，Rust 扩展检测出现误报“过时”的问题。\n- 修复了套利基础场景中币种回退逻辑，使其使用基础批准币种。\n- 修复了优化器评分和帕累托分析中的聚合方法处理逻辑，确保正确应用配置的聚合模式，同时避免对目标进行重复修正。\n","2026-02-24T15:30:31",{"id":201,"version":202,"summary_zh":203,"released_at":204},272242,"v7.8.2","## 亮点\n- 新增可通过 `backtest.candle_interval_minutes` 配置的回测蜡烛聚合功能（默认值为 `1`）。\n- 新增多头\u002F空头高敞口时长指标（`high_exposure_hours_{mean,max}_{long,short}`）。\n- 为回测新增了 `total_wallet_exposure.png` 输出。\n\n## 修复\n- 通过使用绝对敞口大小，修正了纯空头配置下的总钱包敞口指标。\n- 修复了分析中的时间戳日粒度分桶逻辑，避免在聚合区间下出现伪第一日样本。\n- 修复了当使用大于 1 分钟的蜡烛区间时，forager 的 `fills_plots` 对齐问题，现改为基于实际回测蜡烛流进行绘图。\n- 修复了蜡烛区间测试的鲁棒性及在套件\u002F优化器路径间的聚合对齐行为。\n\n## 变更\n- 更新了 `configs\u002Ftemplate.json` 中的默认值、边界和场景配置（包括 `btc_collateral_cap`、`maker_fee_override` 以及优化限制）。\n\n## 备注\n- 蜡烛聚合可提升回测和优化器的运行速度，但会损失区间内的成交顺序精度。\n- 无需用户迁移步骤。\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fcompare\u002Fv7.8.1...v7.8.2","2026-02-09T21:23:11",{"id":206,"version":207,"summary_zh":208,"released_at":209},272243,"v7.7.0","## 亮点\n\n### FillEventsManager 生产环境过渡\n- **PnL 跟踪现已完全使用 FillEventsManager** - 已移除旧版 `update_pnls` 路径\n- **成交事件包含 psize\u002Fpprice** - 每笔成交均标注了持仓数量及加权平均入场价\n- 支持所有交易所：Binance、Bybit、Bitget、GateIO、Hyperliquid、KuCoin、OKX\n\n### 全面日志优化（历经7轮迭代改进）\n\n**标签标准化：**\n- `[memory]`、`[warmup]`、`[hourly]`、`[fills]`、`[mapping]`、`[candle]`、`[ranking]`、`[mode]`\n\n**级别调整：**\n- 常规 API\u002F缓存消息：INFO → DEBUG\n- CCXT API 请求负载：DEBUG → TRACE  \n- 严格模式下的数据缺口：WARNING → DEBUG\n- 持续性数据缺口：WARNING → INFO\n\n**限流机制：**\n- EMA 排名日志：每5分钟记录一次\n- 模式切换：每个品种间隔2分钟\n- KucoinFetcher PnL 差异：间隔1小时，并采用差值去重\n\n**新增功能：**\n- WebSocket 重连时，明确记录 `[ws] reconnecting...` 日志信息\n- 健康概览中，当成交笔数 > 0 时，会显示已实现 PnL\n\n### Bug 修复\n- **Bybit：修复部分平仓成交缺失 PnL 的问题** - `_fetch_positions_history()` 中的分页 bug 导致当记录数超过100条时会跳过部分记录\n\n### 文档更新\n- 新增 `docs\u002Fai\u002Flog_analysis_prompt.md` - 全面的日志分析指南\n- 新增 `docs\u002Fai\u002Fexchange_api_quirks.md` - 各交易所特有的限制说明\n- 新增 `docs\u002Fai\u002Fdebugging_case_studies.md` - 调试案例参考文档\n\n### 已移除内容\n- `--shadow-mode` CLI 标志\n- `live.pnls_manager_shadow_mode` 配置选项\n- 旧版 PnL 相关方法\n\n## 迁移说明\n- **无需额外操作** - FillEventsManager 会自动获取并缓存成交数据\n- 升级后可安全删除旧的 `{user}_pnls.json` 缓存文件\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fcompare\u002Fv7.6.2...v7.7.0","2026-01-26T15:12:07",{"id":211,"version":212,"summary_zh":213,"released_at":214},272244,"v7.6.2","本次发布重点在于提升日志详细程度、修复关键的K线数据问题，并通过更完善的诊断功能优化整体用户体验。\n\n## 🔧 重要 Bug 修复\n\n- **零K线预热修复**：现在，当预热跨度较大（超过2天）且 `end_ts` 存在时，即使触及现有K线，也会通过 CCXT 正确触发缺口补全。此前，机器人会为历史缺口合成数千根零K线，而非获取真实数据。首次预热可能耗时较长（一次性回填），但后续重启速度显著加快（约6秒 vs 约156秒）。\n\n- **单向模式入场修复**：在使用单向模式时，已禁用的交易方向不再阻止入场。机器人现在会根据交易方向配置正确选择初始入场方向。\n\n- **Bybit 杠杆错误处理**：对于“杠杆未修改”（110043）和“保证金模式未修改”（110026）错误，系统将进行优雅处理，不再记录完整的堆栈跟踪信息。\n\n## 📊 日志改进\n\n- **结构化日志前缀**：所有日志消息现均采用带方括号的类别标签，便于筛选：\n  - `[config]` - 配置变更\n  - `[fills]` - 成交事件及盈亏\n  - `[candle]` - K线合成\u002F替换\n  - `[bybit]`、`[binance]` 等 - 交易所特定日志\n\n- **健康摘要增强**：当成交数量大于0时，摘要中会显示累计已实现盈亏，例如 `fills=3 (pnl=+12.50)`。\n\n- **减少日志冗余**：\n  - 零K线日志按每种标的每分钟限流一次。\n  - BybitFetcher 的残余盈亏警告移至调试级别。\n  - FillEventsManager 的刷新日志合并为一行摘要。\n\n- **更清晰的时间戳**：零K线警告现包含可读的 UTC 时间戳，明确显示合成的具体时间范围。\n\n## ⚙️ 新增配置选项\n\n- `live.enable_archive_candle_fetch`（默认：false）：可选择启用交易所的历史K线数据获取功能。默认关闭以避免超时问题。回测器则始终使用历史数据，不受此设置影响。\n\n- `live.warmup_jitter_seconds`（默认：30）：预热开始前增加随机延迟，以防止多台机器人同时启动时触发API速率限制。\n\n- `live.max_concurrent_api_requests`（默认：无）：可选的 CCXT API 调用全局并发上限。\n\n- `backtest.maker_fee_override`（默认：无）：可在回测或优化器中覆盖Maker手续费，适用于测试不同费率档位。\n\n## 🖥️ UI 改进\n\n- **TWEL 说明更新**：启动横幅现显示“TWEL”（总持仓限额），而非简单的“Exposure”，以明确其为限额而非当前持仓水平。多空模式下会同时显示多头和空头的限额，例如 `TWEL: L:125% S:85%`。\n\n- **动态横幅宽度**：启动横幅宽度现可根据内容动态调整，避免边框错位。\n\n## 🐛 其他修复\n\n- Windows 缓存兼容性：文件夹名称在 Windows 系统上，或当设置了 `WINDOWS_COMPATIBILITY=1` 环境变量时，会将 `:` 替换为 `_` (#547，感谢 @FelixJongleur42)。\n\n- Pareto 仪表盘：修复了在切换标签页时出现的 JavaScript 回调错误 (#550，感谢 @646826)。\n\n## 📦 依赖项\n\n- 在 `requirements-live.txt` 中新增了 `openpyxl`（用于…","2026-01-20T18:56:55",{"id":216,"version":217,"summary_zh":218,"released_at":219},272245,"v7.6.0","详情请参见 changelog.md。","2026-01-03T17:58:35",{"id":221,"version":222,"summary_zh":223,"released_at":224},272246,"v7.5.7","## Passivbot v7.5.7 发行说明\n\n### 亮点\n- **CCXT 升级至 4.5.22**，以提升交易所兼容性，并新增 KuCoin 对冲模式强制执行及订单负载修复。\n- **规范套件指标与帕累托优化重构**，确保优化器和回测器输出一致，同时将帕累托逻辑集中化。\n- **更清晰的余额\u002F持仓编排**：机器人会并发获取余额和持仓，待两者均为最新状态后再统一记录日志。\n\n### 详细变更\n\n#### 交易所与机器人行为\n- CCXT 升级至 v4.5.22，并添加回归测试以检测未来可能破坏 CCXT 兼容性的变更。\n- KuCoin 机器人现强制启用对冲模式（如支持），并能优雅处理交易所拒绝的情况，同时正确发送 `marginMode` 和 `positionSide` 订单参数。\n- 所有交易所封装层现将 `fetch_positions()` 和 `fetch_balance()` 分开；调用方可独立刷新这两项数据。\n- `update_positions_and_balance()` 会并发获取余额和持仓，待两者完成后再记录持仓差值，并仅触发一次余额变化事件，从而确保权益日志始终基于最新的持仓和未实现盈亏。\n\n#### 优化与回测\n- 新增 `pareto_core.py`，整合帕累托支配与拥挤度逻辑，并加入极端值保留剪枝功能。\n- 套件运行器和优化器现输出相同的规范套件指标负载（汇总统计 + 各场景均值）。\n- ParetoStore 现委托共享辅助函数，以确保 CLI 工具间支配\u002F聚类规则的一致性。\n\n#### 配置与覆盖\n- 新增前向\u002F后向止盈网格覆盖（PR #532），并在加载实时或套件配置时修复模板与归一化问题。\n- 改进了套件启用时的覆盖解析行为及日志记录。\n\n#### 文档\n- 扩展文档内容，涵盖最低有效成本计算、追踪网格比率以及新的变更日志政策。\n- 记录了 KuCoin 对冲模式的设置方法，以便用户在 CCXT 升级后了解预期行为。\n\n#### 测试与工具\n- 新增 KuCoin 交易所配置的回归测试（对冲\u002F保证金\u002F杠杆），并更新了 Passivbot 的余额测试。\n- 更新了测试桩代码，使 `passivbot_rust` 和 CCXT 模拟对象反映新的获取与日志分离机制。\n\n## 变更内容\n* @Couillos 在 https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F532 中恢复了前向\u002F后向止盈网格逻辑。\n\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fcompare\u002Fv7.5.4...v7.5.7","2025-11-27T18:38:52",{"id":226,"version":227,"summary_zh":228,"released_at":229},272247,"v7.5.4","## 亮点\n- 新增了与抵押品无关的绩效指标（`adg_pnl`、`mdg_pnl`，以及基于损益的夏普比率\u002F索提诺比率，并提供加权版本），并完成了相关文档编写。\n- 通过新增文档、测试和调试日志，改进了币种覆盖配置的用户体验和安全性。\n- 重构了仓位\u002F余额处理逻辑，将更新流程分离，并优化了Hyperliquid的联合获取操作。\n- 增强了数据同步机制、成交事件缓存布局以及Kucoin未成交订单分页功能的健壮性。\n- 扩展了优化器的限价单处理能力，引入了新的`limit_utils`模块，并加强了限价单与评分系统的集成。\n\n## 指标与分析\n- 新增指标：`adg_pnl`、`mdg_pnl`（以日终余额为基准的平均\u002F中位数每日损益），以及基于损益的`sharpe_ratio_pnl`\u002F`sortino_ratio_pnl`，并提供了加权版本。\n- 在`docs\u002Fmetrics.md`中补充了条目，明确了权益与损益型夏普\u002F索提诺比率的语义差异。\n- 更新了Rust和Python客户端中的类型定义及分析逻辑；优化器权重和配置规范化已支持新指标。\n- 新增了优化器端的限价工具模块（`limit_utils`）及集成测试，以确保限价单的标准化处理和惩罚机制的一致性。\n\n## 币种覆盖配置\n- 编写了完整的覆盖配置行为文档（`docs\u002Fcoin_overrides.md`），包含内联和文件形式的示例、允许的字段、路径解析规则及常见陷阱。\n- 在初始化覆盖配置及使用覆盖值时添加了调试日志。\n- 扩充了测试用例，覆盖了路径解析、缺失覆盖文件以及配置格式化后的保留情况。\n\n## 交易所与同步修复\n- Kucoin：`fetch_open_orders`现支持分页查询（不再限制为每次最多50笔订单）。\n- Hyperliquid：`fill_events_manager`现已支持该交易所；每轮循环仅执行一次联合获取仓位和余额的操作。\n- 通用改进：所有交易所的仓位和余额获取被拆分为独立接口（`fetch_balance`和`fetch_positions`），并通过余额缓存避免对联合接口的重复调用。\n- `sync_tar.py`：拉取单个文件时不再额外嵌套目录结构。\n- 优化器：引入了新的限价单处理流水线（`limit_utils`），增强了评分与限价单的解析能力，并增加了针对优化器限价单的测试用例。\n\n## 成交事件\n- 缓存根目录现调整为`caches\u002F{exchange}\u002F{user}`（原为`caches\u002F{exchange}_{user}`）。\n- 注册了Hyperliquid的成交事件获取接口；CLI不再拒绝Hyperliquid用户。\n\n## 核心重构与安全防护\n- 将`update_positions`与新增的`update_balance`分离；主循环分别调用两者。\n- 添加了余额缓存复用机制，以及速率限制和网络保护措施。\n- 针对余额拆分和Hyperliquid联合获取的复用场景新增了测试用例。\n- 新增了优化器限价单的集成测试，并扩展了限价工具模块的测试覆盖率。\n\n## 文档\n- 补充了币种覆盖配置指南及指标参考文档的更新内容。\n\n## 质量保证与测试\n- 新增测试：覆盖路径处理、余额拆分行为、Hyperliquid联合获取的复用情况，以及Hyperliquid成交事件获取接口的对接。\n- 新增了优化器限价单集成测试和`limit_utils`测试。\n- 现有测试套件在定向运行中持续通过（并对新增测试进行了抽样检查）。\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fcompare\u002Fv7.5.0...v7.5.4","2025-11-26T15:25:47",{"id":231,"version":232,"summary_zh":233,"released_at":234},272248,"v7.5.0","# Passivbot v7.5.0 (TWEL Enforcer)\r\n\r\n**Highlights**\r\n\r\n- **Risk controls & TWEL enforcer**\r\n  - Added `risk_we_excess_allowance_pct`, `risk_wel_enforcer_threshold`, and companion Rust helpers that auto-reduce positions when wallet exposure drifts beyond the buffer.\r\n  - Implemented TWEL (Total Wallet Exposure Limit) gating in Rust with Python wiring, per-position prioritisation, and optimizer bounds\u002FCLI flags.\r\n  - Refined unstuck logic so both live bot and backtester use the same Rust helpers; unstuck can now be disabled by setting a negative threshold.\r\n\r\n- **Optimizer overhaul**\r\n  - Shared-memory HLCV bundles and per-scenario slicing remove per-worker copies, cutting RAM growth as CPU count increases.\r\n  - Streaming evaluator outputs: each candidate logs Pareto updates immediately, duplicate detection got stricter, and starting-config logging\u002Fimmediate termination handling improved.\r\n  - Suite support landed: optimisations can now evaluate multiple scenarios per candidate (with config cleaners, override helpers, and scenario metrics aggregation).\r\n  - Added Pareto dashboard (WIP) and metrics-only mode; template configs updated with new suites and defaults.\r\n\r\n- **Logging & monitoring**\r\n  - Order-plan logging is now quiet when unchanged, but includes delta\u002Fcontext details when cancels\u002Fcreates actually happen; tolerance gating prevents churn.\r\n  - Candlestick manager detects sparse exchange feeds once per `(exchange,symbol,tf)` and still standardises gaps with synthetic zero-candles.\r\n  - Balance snapshot\u002Flogging knobs moved to `config.logging`; log-once helper ensures repeated warnings appear only once per symbol.\r\n\r\n- **Config & CLI improvements**\r\n  - Template config refreshed with new risk knobs, trailing weights, and optimizer bounds; `config_utils` tracks transforms and exposes `_raw` data.\r\n  - CLI overrides for optimise bounds now only freeze the key you actually pass (e.g. `-lnp 4` pins long positions to 4, leaving other bounds untouched).\r\n  - Added knobs such as `recv_window_ms`, `balance_sample_divider`, `logging.volume_refresh_info_threshold_seconds`, and updated docs.\r\n\r\n- **Backtest & analysis**\r\n  - Introduced `HlcvsBundle` and payload subset helpers; backtest payloads now carry coin metadata in Rust and Python tests cover slicing\u002Fvalidation.\r\n  - New scoring metrics (`entry_initial_balance_pct_long`, drawdown limits, volatility-weighted trailing entries) and renamed config fields to match.\r\n  - Added scripts\u002Ftools (`shared_arrays.py`, JSON streamliner, new Pareto utilities) plus doc updates (`passivbot_agent_principles.yaml`, CONTRIBUTING).\r\n\r\n- **Fill events manager (WIP)**\r\n  - New `src\u002Ffill_events_manager.py` adds modular fetchers (Bitget, Bybit, Binance) with caching and enrichment plus a CLI runner and tests. Live bot still uses legacy `fetch_pnls`; the manager will coexist while it matures.\r\n\r\n**Thanks** to everyone who tested TWEL enforcer, optimiser RAM fixes, and the expanding docs\u002Ftooling ecosystem.\r\n\r\n## What's Changed\r\n* Fix res.get() trying to expanding the objectives in case of seen hash by @TayyabTalha in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F526\r\n* V7.5.0 twel enforcer by @TayyabTalha in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F527\r\n* V7.5.0 twel enforcer by @enarjord in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F531\r\n\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fcompare\u002Fv7.4.4...v7.5.0","2025-11-23T15:12:05",{"id":236,"version":237,"summary_zh":238,"released_at":239},272249,"v7.4.4","Last release before v7.5\r\n\r\n## What's Changed\r\n* add metrics total_wallet_exposure_max, mean, median by @backstab in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F528\r\n\r\n## New Contributors\r\n* @backstab made their first contribution in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F528\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fcompare\u002Fv7.4.1...v7.4.4","2025-11-23T14:50:06",{"id":241,"version":242,"summary_zh":243,"released_at":244},272250,"v7.4.1","- Introduced configurable REST endpoint overrides via configs\u002Fcustom_endpoints.json, including CLI\u002Fconfig opt‑in and automatic websocket disabling.\r\n- Added loader intelligence for hostname placeholders and detailed startup logging.\r\n- Documented the setup flow and added pytest coverage to ensure ccxt rewrites and headers behave as intended.\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fcompare\u002Fv7.4.0...v7.4.1","2025-10-13T16:54:23",{"id":246,"version":247,"summary_zh":248,"released_at":249},272251,"v7.4.0","### Market Data & Candles\r\n* Introduced an asynchronous CandlestickManager with on-disk caching, metadata, and gap repair.\r\n* Added EMA\u002Flog-range series APIs, optional pagination limits, and higher-timeframe fetching (_tf_to_ms, get_latest_ema_*, etc.).\r\n* Align warmup windows between backtester and live; new config keys (inactive_coin_candle_ttl_minutes, entry_grid_spacing_log_*, filter_log_range_ema_span) replace legacy rolling-window settings.\r\nprocedures.get_first_timestamps_unified() now defers Bitget lookups until cheaper exchanges fail and iteratively discovers earliest timestamps.\r\n\r\n### Risk & Execution Controls\r\n* Expanded noise → log-range filters for coin selection and grid spacing, including hourly EMA modulation.\r\n* Panic-close and auto-unstuck pipelines hardened; existing unstuck safeguards extended with exchange overrides.\r\n* Live bot now prevents disabled sides from refilling approved lists and only logs the disable event once.\r\n* Added hourly memory snapshots to Passivbot telemetry.\r\n\r\n### Backtester & Optimizer\r\n* Refined warmup\u002Fbackfill handling (first_timestamp_ms, 1h alignment, improved gap repair).\r\n* Optimizer gains fine-tune mode (--fine_tune_params), CLI-friendly bounds and limits, and updated docs.\r\n* Various Rust backtest enhancements (analysis.rs, extended metrics, timestamp clamping).\r\n\r\n### Configs & Examples\r\n* Template and example configs refreshed to use new log-range EMA spans, trailing weights, and log spacing fields.\r\n* Added max_memory_candles_per_symbol defaults and refined per-exchange warmup ratio handling.\r\n* Removed stale all_approved.json example; hyperliquid guide\u002Fdocs updated accordingly.\r\n\r\n### Tooling & Requirements\r\n* Rust toolchain pinned to 1.76; requirements.txt now includes maturin\u002Fportalocker\u002Fportalocker.\r\n* README & docs clarified around installation, Windows venv activation, optimizer fine-tuning, and backtest data (downloader-based archives).\r\n\r\n### Miscellaneous\r\n* Logging tidy-ups (throttled EMA progress, reduced noisy lines).\r\n* Several .gitignore additions, dependency updates, and formatting runs (black).\r\n* Tests expanded for CandlestickManager and Passivbot’s unstuck flow, ensuring new behaviour is well-covered.\r\n\r\n## What's Changed\r\n* Merge v7.4.0_noisiness into master: noise-aware filters, smarter panic exits, and Rust backtest upgrades by @enarjord in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F523\r\n\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fcompare\u002Fv7.3.21...v7.4.0","2025-10-11T19:03:40",{"id":251,"version":252,"summary_zh":253,"released_at":254},272252,"v7.3.21","Release Highlights (v7.3.21 vs v7.3.20)\r\n\r\n- Introduced an asynchronous CandlestickManager with disk-backed caching, automatic gap repair, and earliest-ts metadata. Requests now clamp to discovered history, and a new pytest suite guards the cache behaviour.\r\n- Reworked symbol screening: filter_markets is now a shared utility, and UTC handling in ts_to_date is consistent across the bot.\r\n- Order execution pipeline gained “panic close” support and refined order-type handling; a follow-up patch fixed an edge case where panic close could fail.\r\n- Rust backtest tooling grew substantially (new analysis module, ADX-driven trailing flip logic, richer metrics, error handling, and max-flip tracking). Supporting dependencies were added in the Rust workspace.\r\n- Documentation refresh: README now covers Windows activation paths and references the Hyperliquid vault; outdated Passivbot imagery was removed.\r\n- Miscellaneous housekeeping: expanded .gitignore, removal of stale notebooks\u002Fconfigs, and other formatting cleanups.\r\n\r\nThese changes focus on sturdier market-data handling, sharper backtest analytics, and safer order-management controls while keeping configuration untouched.\r\n\r\n## What's Changed\r\n* Update README for Windows users by @ozymotv in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F517\r\n* Window crashes fix 7.3.15 by @ozymotv in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F516\r\n* Zone recovery improvements  by @Belgianwafflecorp in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F520\r\n* Fix import for generate mcap list by @TayyabTalha in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F521\r\n\r\n## New Contributors\r\n* @Belgianwafflecorp made their first contribution in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F520\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fcompare\u002Fv7.3.20...v7.3.21","2025-10-11T18:37:37",{"id":256,"version":257,"summary_zh":258,"released_at":259},272253,"v7.3.20","- officially added Kucoin exchange","2025-08-31T15:21:35",{"id":261,"version":262,"summary_zh":263,"released_at":264},272254,"v7.3.19","**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fcompare\u002Fv7.3.16...v7.3.19","2025-08-26T15:48:06",{"id":266,"version":267,"summary_zh":268,"released_at":269},272255,"v7.3.16","- backtester will now update effective n_positions and wallet exposure limits for each coin dynamically, like live bot does\r\n- increase grid\u002Ftrailing allocations by 1% to overshoot grid_trailing_ratio_threshold\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fcompare\u002Fv7.3.15...v7.3.16","2025-07-29T16:10:40",{"id":271,"version":272,"summary_zh":273,"released_at":274},272256,"v7.3.15","- rollback ccxt from v4.4.96 to v4.4.90 due to breaking changes","2025-07-26T20:39:34",{"id":276,"version":277,"summary_zh":278,"released_at":279},272257,"v7.3.14","- replaces coin flags with coin overrides\r\n- adds coin overrides to backtest\r\n- adds safeguards to prevent bot making duplicate orders\r\n- up ccxt version to 4.4.96\r\n- allow selecting subset of objectives for pareto front when using src\u002Fpareto.py\r\n- remove mimic_backtest_1m_delay feature from live bot\r\n- other fixes and improvements\r\n\r\n## What's Changed\r\n* Master by @msei99 in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F510\r\n* New requirements-live.txt and passivbot-live service added to docker-compose.yml by @Couillos in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F508\r\n* skipping get_first_timestamp exception by @JohnyX in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F511\r\n* Fixes for trailing entries and closes by @TayyabTalha in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F512\r\n* V7.3.14 coin overrides by @enarjord in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F515\r\n\r\n## New Contributors\r\n* @Couillos made their first contribution in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F508\r\n* @JohnyX made their first contribution in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F511\r\n* @TayyabTalha made their first contribution in https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fpull\u002F512\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fenarjord\u002Fpassivbot\u002Fcompare\u002Fv7.3.13...v7.3.14","2025-07-26T13:45:36"]