[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-sadighian--crypto-rl":3,"tool-sadighian--crypto-rl":64},[4,23,32,40,48,56],{"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 将是理想的起点。",84991,2,"2026-04-05T10:45:23",[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},2234,"scikit-learn","scikit-learn\u002Fscikit-learn","scikit-learn 是一个基于 Python 构建的开源机器学习库，依托于 SciPy、NumPy 等科学计算生态，旨在让机器学习变得简单高效。它提供了一套统一且简洁的接口，涵盖了从数据预处理、特征工程到模型训练、评估及选择的全流程工具，内置了包括线性回归、支持向量机、随机森林、聚类等在内的丰富经典算法。\n\n对于希望快速验证想法或构建原型的数据科学家、研究人员以及 Python 开发者而言，scikit-learn 是不可或缺的基础设施。它有效解决了机器学习入门门槛高、算法实现复杂以及不同模型间调用方式不统一的痛点，让用户无需重复造轮子，只需几行代码即可调用成熟的算法解决分类、回归、聚类等实际问题。\n\n其核心技术亮点在于高度一致的 API 设计风格，所有估算器（Estimator）均遵循相同的调用逻辑，极大地降低了学习成本并提升了代码的可读性与可维护性。此外，它还提供了强大的模型选择与评估工具，如交叉验证和网格搜索，帮助用户系统地优化模型性能。作为一个由全球志愿者共同维护的成熟项目，scikit-learn 以其稳定性、详尽的文档和活跃的社区支持，成为连接理论学习与工业级应用的最",65628,1,"2026-04-05T10:10:46",[20,18,14],{"id":33,"name":34,"github_repo":35,"description_zh":36,"stars":37,"difficulty_score":10,"last_commit_at":38,"category_tags":39,"status":22},3364,"keras","keras-team\u002Fkeras","Keras 是一个专为人类设计的深度学习框架，旨在让构建和训练神经网络变得简单直观。它解决了开发者在不同深度学习后端之间切换困难、模型开发效率低以及难以兼顾调试便捷性与运行性能的痛点。\n\n无论是刚入门的学生、专注算法的研究人员，还是需要快速落地产品的工程师，都能通过 Keras 轻松上手。它支持计算机视觉、自然语言处理、音频分析及时间序列预测等多种任务。\n\nKeras 3 的核心亮点在于其独特的“多后端”架构。用户只需编写一套代码，即可灵活选择 TensorFlow、JAX、PyTorch 或 OpenVINO 作为底层运行引擎。这一特性不仅保留了 Keras 一贯的高层易用性，还允许开发者根据需求自由选择：利用 JAX 或 PyTorch 的即时执行模式进行高效调试，或切换至速度最快的后端以获得最高 350% 的性能提升。此外，Keras 具备强大的扩展能力，能无缝从本地笔记本电脑扩展至大规模 GPU 或 TPU 集群，是连接原型开发与生产部署的理想桥梁。",63927,"2026-04-04T15:24:37",[20,14,18],{"id":41,"name":42,"github_repo":43,"description_zh":44,"stars":45,"difficulty_score":10,"last_commit_at":46,"category_tags":47,"status":22},2403,"crawl4ai","unclecode\u002Fcrawl4ai","Crawl4AI 是一款专为大语言模型（LLM）设计的开源网络爬虫与数据提取工具。它的核心使命是将纷繁复杂的网页内容转化为干净、结构化的 Markdown 格式，直接服务于检索增强生成（RAG）、智能体构建及各类数据管道，让 AI 能更轻松地“读懂”互联网。\n\n传统爬虫往往面临反爬机制拦截、动态内容加载困难以及输出格式杂乱等痛点，导致后续数据处理成本高昂。Crawl4AI 通过内置自动化的三级反机器人检测、代理升级策略以及对 Shadow DOM 的深度支持，有效突破了这些障碍。它能智能移除同意弹窗，处理深层链接，并具备长任务崩溃恢复能力，确保数据采集的稳定与高效。\n\n这款工具特别适合开发者、AI 研究人员及数据工程师使用。无论是需要为本地模型构建知识库，还是搭建大规模自动化信息采集流程，Crawl4AI 都提供了极高的可控性与灵活性。作为 GitHub 上备受瞩目的开源项目，它完全免费开放，无需繁琐的注册或昂贵的 API 费用，让用户能够专注于数据价值本身而非采集难题。",63242,"2026-04-02T22:29:19",[14,17],{"id":49,"name":50,"github_repo":51,"description_zh":52,"stars":53,"difficulty_score":10,"last_commit_at":54,"category_tags":55,"status":22},193,"meilisearch","meilisearch\u002Fmeilisearch","Meilisearch 是一个开源的极速搜索服务，专为现代应用和网站打造，开箱即用。它能帮助开发者快速集成高质量的搜索功能，无需复杂的配置或额外的数据预处理。传统搜索方案往往需要大量调优才能实现准确结果，而 Meilisearch 内置了拼写容错、同义词识别、即时响应等实用特性，并支持 AI 驱动的混合搜索（结合关键词与语义理解），显著提升用户查找信息的体验。\n\nMeilisearch 特别适合 Web 开发者、产品团队或初创公司使用，尤其适用于需要快速上线搜索功能的场景，如电商网站、内容平台或 SaaS 应用。它提供简洁的 RESTful API 和多种语言 SDK，部署简单，资源占用低，本地开发或生产环境均可轻松运行。对于希望在不依赖大型云服务的前提下，为用户提供流畅、智能搜索体验的团队来说，Meilisearch 是一个高效且友好的选择。",56972,"2026-04-05T22:34:33",[13,17,14,20,16,18],{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":22},223,"Made-With-ML","GokuMohandas\u002FMade-With-ML","Made-With-ML 是一个面向实战的开源项目，旨在帮助开发者系统掌握从设计、开发到部署和迭代生产级机器学习应用的完整流程。它解决了许多人在学习机器学习时“会训练模型但不会上线”的痛点，强调将软件工程最佳实践与 ML 技术结合，构建可靠、可维护的端到端系统。\n\n该项目特别适合三类人群：一是希望将模型真正落地的开发者（包括软件工程师、数据科学家）；二是刚毕业、想补齐工业界所需技能的学生；三是需要理解技术边界以更好推动产品的技术管理者或产品经理。\n\nMade-With-ML 的亮点在于注重第一性原理讲解，避免盲目调包；同时覆盖 MLOps 关键环节（如实验跟踪、模型测试、服务部署、CI\u002FCD 等），并支持在 Python 生态内平滑扩展训练与推理任务，无需切换语言或复杂基础设施。课程内容结构清晰，配有详细代码示例和视频导览，兼顾理论深度与工程实用性。",47120,"2026-04-05T22:16:18",[19,18,14,16,20],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":80,"owner_email":81,"owner_twitter":79,"owner_website":82,"owner_url":83,"languages":84,"stars":89,"forks":90,"last_commit_at":91,"license":79,"difficulty_score":92,"env_os":93,"env_gpu":94,"env_ram":95,"env_deps":96,"category_tags":105,"github_topics":106,"view_count":127,"oss_zip_url":79,"oss_zip_packed_at":79,"status":22,"created_at":128,"updated_at":129,"faqs":130,"releases":161},150,"sadighian\u002Fcrypto-rl","crypto-rl","Deep Reinforcement Learning toolkit: record and replay cryptocurrency limit order book data & train a DDQN agent","crypto-rl 是一个面向加密货币交易研究的深度强化学习开源工具包。它能从 Coinbase Pro 和 Bitfinex 两大交易所实时记录完整的限价订单簿（Limit Order Book）和逐笔成交数据，并将数据存储在基于 MongoDB 的 Arctic 数据库中；随后支持回放历史数据，提取特征用于训练交易智能体。项目内置了一个基于 DDQN（Double Deep Q-Network）算法的示例智能体，帮助用户快速上手构建自己的交易策略。\n\n该工具主要解决研究人员在复现强化学习交易论文时缺乏高质量、结构化市场微观数据的问题。其特色在于完整保留了订单簿的动态细节，并提供了与 OpenAI Gym 兼容的自定义交易环境（gym_trading），便于集成各类强化学习算法。此外，技术指标实现注重效率，部分达到 O(1) 时间复杂度。\n\ncrypto-rl 专为量化金融领域的研究人员和算法开发人员设计，适用于学术实验或策略原型开发，但不支持实盘交易。适合希望探索基于订单流数据的智能交易系统、并具备 Python 和强化学习基础的用户使用。","# Deep Reinforcement Learning Toolkit for Cryptocurrencies\n\n\n**Table of contents:**\n\n1. Purpose\n2. Scope\n3. Dependencies\n4. Project structure\n5. Design patterns\n6. Getting started\n7. Citing this project\n8. Appendix \n\n## 1. Purpose\nThe purpose of this application is to provide a toolkit to:\n - **Record** full limit order book and trade tick data from two \n exchanges (**Coinbase Pro** and **Bitfinex**) into an [Arctic](https:\u002F\u002Fgithub.com\u002Fmanahl\u002Farctic) \n Tickstore database (i.e., MongoDB), \n - **Replay** recorded historical data to derive feature sets for training\n - **Train** an agent to trade cryptocurrencies using the DQN algorithm (note: this agent\n  implementation is intended to be an example for users to reference)\n\n![High_Level_Overview](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsadighian_crypto-rl_readme_ed51ef66805a.png)\n\n\n## 2. Scope\n- **Research only:** there is no capability for live-trading at exchanges.\n- **Reproducing RL paper results:** the dataset used for [this](https:\u002F\u002Farxiv.org\u002Fabs\u002F2004.06985) article is available on [Kaggle Datasets](https:\u002F\u002Fwww.kaggle.com\u002Fjsadighian\u002Fcryptorl).\n\n\n## 3. Dependencies\nSee `requirements.txt`\n\n*Note*: to run and train the DQN Agent (`.\u002Fagent\u002Fdqn.py`) tensorflow and Keras-RL\nneed to be installed manually and are not listed in the `requirements.txt` \nin order to keep this project compatible with other open \nsourced reinforcement learning platforms \n(e.g., [OpenAI Baselines](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fbaselines)).\n\nPip install the following:\n\n```\ngit+https:\u002F\u002Fgithub.com\u002Fmanahl\u002Farctic.git\n\nKeras==2.2.4\nKeras-Applications==1.0.7\nKeras-Preprocessing==1.0.9\nkeras-rl==0.4.2\n\ntensorboard==1.13.1\ntensorflow-estimator==1.13.0\ntensorflow-gpu==1.13.1\n```\n\n\n## 4. Project Structure\nThe key elements in this project and brief descriptions.\n```\ncrypto-rl\u002F\n\tagent\u002F\n\t\t\t\t...reinforcement learning algorithm implementations\n\tdata_recorder\u002F\n\t\t\t\t...tools to connect, download, and retrieve limit order book data\n\tgym_trading\u002F\n\t\t\t\t...extended openai.gym environment to observe limit order book data\n\tindicators\u002F\n\t\t\t\t...technical indicators implemented to be O(1) time complexity\n\tdesign-patterns\u002F\n\t\t\t\t...visual diagrams module architecture\n\tvenv\u002F\n\t\t\t\t...virtual environment for local deployments\n\texperiment.py          # Entry point for running reinforcement learning experiments\n\trecorder.py            # Entry point to start recording limit order book data\n\tconfigurations.py      # Constants used throughout this project\n\trequirements.txt       # List of project dependencies\n\tsetup.py               # Run the command `python3 setup.py install` to \n\t                       #    install the extended gym environment i.e., gym_trading.py\n```\n\n\n## 5. Design Patterns\nRefer to each individual module for design pattern specifications:\n\n- [Limit Order Book, Data Recorder, and Database](.\u002Fdata_recorder\u002FREADME.md)\n- [Stationary LOB Features](https:\u002F\u002Farxiv.org\u002Fabs\u002F1810.09965v1)\n- [POMDP Environment](.\u002Fgym_trading\u002FREADME.md)\n- [Learning Algorithms and Neural Networks](.\u002Fagent\u002FREADME.md)\n\nSample snapshot of Limit Order Book levels:\n![plot_lob_levels](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsadighian_crypto-rl_readme_72a4304385ed.png)\n\nSample snapshot of Order Arrival flow metrics:\n![plot_order_arrivals](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsadighian_crypto-rl_readme_e589b5c87dcb.png)\n\n\n## 6. Getting Started\n\nInstall the project on your machine:\n```\n# Clone the project from github\ngit clone https:\u002F\u002Fgithub.com\u002Fsadighian\u002Fcrypto-rl.git\ncd crypto-rl\n\n# Install a virtual environment for the project's dependencies\npython3 -m venv .\u002Fvenv\n\n# Turn on the virtual environment\nsource venv\u002Fbin\u002Factivate\n\n# Install keras-rl dependencies\npip3 install Keras==2.2.4 Keras-Applications==1.0.7 Keras-Preprocessing==1.0.9 keras-rl==0.4.2\n tensorboard==1.13.1 tensorflow-estimator==1.13.0 tensorflow-gpu==1.13.1\n \n# Install database\npip3 install git+https:\u002F\u002Fgithub.com\u002Fmanahl\u002Farctic.git\n\n# Install the project\npip3 install -e .\n```\n\n### 6.1 Record limit order book data from exchanges\n\n**Step 1:**\nGo to the `configurations.py` and define the crypto currencies which\nyou would like to subscribe and record. \n\nNote: basket list format is as follows `[(Coinbase_Instrument_Name, Bitfinex_Instrument_Name), ...]`\n```\nSNAPSHOT_RATE = 5  # I.e., every 5 seconds\nBASKET = [('BTC-USD', 'tBTCUSD'),\n         ('ETH-USD', 'tETHUSD'),\n         ('LTC-USD', 'tLTCUSD'),\n         ('BCH-USD', 'tBCHUSD'),\n         ('ETC-USD', 'tETCUSD')]\nRECORD_DATA = True\n```\n\n**Step 2:**\nOpen a CLI\u002Fterminal and execute the command to start recording \nfull limit order book and trade data.\n ```\n python3 recorder.py\n ```\n\n### 6.2 Replay recorded data to export stationary feature set\n\n**Step 1:**\nEnsure that you have data in your database. \n\nCheck with MongoDB shell or [Compass](https:\u002F\u002Fwww.mongodb.com\u002Fproducts\u002Fcompass). \nIf you do not have data, see refer to the section above \n**6.1 Record limit order book data from exchanges**.\n\n**Step 2:**\nRun a historial data simulation to take snapshots of the\nlimit order book(s) and export their stationary features\nto a compressed csv.\n\nTo do this, you can leverage the test cases in `data_recorder\u002Ftests\u002F`\nor write your own logic. When using the test case methods, make sure\nto change the query parameters to match what you've actually recorded and\nis in your database.\n\nExample to export features to a compressed csv:\n```\npython3 data_recorder\u002Ftests\u002Ftest_extract_features.py\n```\n\n### 6.3 Train an agent\n\n**Step 1:**\nEnsure you have data in the `data_recorder\u002Fdatabase\u002Fdata_exports\u002F` folder.\nThis is where the agent loads data from. If you do not have data exported\ninto that folder, see refer to the section above \n**6.2 Replay recorded data to export stationary feature set**.\n\n**Step 2:**\nOpen a CLI\u002Fterminal and start learning\u002Ftraining the agent. \n```\npython3 experiment.py --window_size=50 --weights=False --fitting_file=...\n```\nRefer to `experiment.py` to see all the keyword arguments.\n\n\n## 7. Citing this project\n\nPlease remember to cite this repository if used in your research:\n```\n    @misc{Crypto-RL,\n        author = {Jonathan Sadighian},\n        title = {Deep Reinforcement Learning Toolkit for Cryptocurrencies},\n        year = {2019},\n        publisher = {GitHub},\n        journal = {GitHub repository},\n        howpublished = {\\url{https:\u002F\u002Fgithub.com\u002Fsadighian\u002Fcrypto-rl}},\n    }\n```\n\n\n## 8. Appendix\n### 8.1 Branches\nThere are multiple branches of this project, each with a different implementation pattern \nfor persisting data:\n - **FULL** branch is intended to be the foundation for a fully automated trading system \n (i.e., implementation of design patterns that are ideal for a trading system that requires \n parallel processing) and persists streaming tick data into an **Arctic Tick Store**\n \n **Note:** the branches below (i.e., lightweight, order book snapshot, mongo integration) \n are no longer actively maintained as of October 2018, and are here for reference.\n \n - **LIGHT WEIGHT** branch is intended to record streaming data more efficiently than \n the __full__ branch (i.e., all websocket connections are made from a single process \n __and__ the limit order book is not maintained) and persists streaming tick data into \n an **Arctic tick store**\n - **ORDER BOOK SNAPSHOT** branch has the same design pattern as the __full__ branch, \n but instead of recording streaming ticks, snapshots of the limit order book are taken \n every **N** seconds and persisted into an **Arctic tick store**\n - **MONGO INTEGRATION** branch is the same implementation as **ORDER BOOK SNAPSHOT**, \n with the difference being a standard MongoDB is used, rather than Arctic. \n This branch was originally used to benchmark Arctic's performance and is not up to \n date with the **FULL** branch.\n\n### 8.2 Assumptions\n- You have installed a virtual environment and installed the project to that venv \n(e.g., `pip3 install -e .`)\n- You have mongoDB already installed\n- You know how to use a cli to start python scripts\n- You are running an ubuntu 18+ os\n\n### 8.3 Change Log\n- 2021-09-25: Updated `requirements.txt`: going forward the database requires a manual \n  installation via `pip install git+https:\u002F\u002Fgithub.com\u002Fmanahl\u002Farctic.git`\n- 2019-12-12: Added docstrings and refactored many classes to improve code readability\n- 2019-09-18: Refactored `env`s and `broker`s for simplification and\n  added different `reward` approaches.\n- 2019-09-13: Created and implemented 'order arrival' flow metrics,\n  inspired by\n  [Multi-Level Order-Flow Imbalance in a Limit Order Book](https:\u002F\u002Farxiv.org\u002Fabs\u002F1907.06230v1)\n  by Xu, Ke; Gould, Martin D.; Howison, Sam D.\n- 2019-09-06: Created and implemented `Indicator.py` base class\n- 2019-04-28: Reorganized project structure for simplicity\n","# 加密货币深度强化学习工具包（Deep Reinforcement Learning Toolkit for Cryptocurrencies）\n\n\n**目录：**\n\n1. 目的  \n2. 范围  \n3. 依赖项  \n4. 项目结构  \n5. 设计模式  \n6. 快速入门  \n7. 引用本项目  \n8. 附录  \n\n## 1. 目的\n本应用旨在提供一个工具包，用于：\n - **记录（Record）** 来自两个交易所（**Coinbase Pro** 和 **Bitfinex**）的完整限价订单簿（Limit Order Book）和逐笔交易（trade tick）数据，并将其存入 [Arctic](https:\u002F\u002Fgithub.com\u002Fmanahl\u002Farctic) Tickstore 数据库（即 MongoDB）中；\n - **回放（Replay）** 已记录的历史数据，以生成用于训练的特征集；\n - **训练（Train）** 使用 DQN（Deep Q-Network，深度 Q 网络）算法进行加密货币交易的智能体（agent）（注意：此智能体实现仅作为用户参考的示例）。\n\n![High_Level_Overview](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsadighian_crypto-rl_readme_ed51ef66805a.png)\n\n\n## 2. 范围\n- **仅限研究用途**：本项目不具备在交易所进行实盘交易的能力。\n- **复现强化学习论文结果**：[这篇](https:\u002F\u002Farxiv.org\u002Fabs\u002F2004.06985) 文章所使用的数据集已在 [Kaggle Datasets](https:\u002F\u002Fwww.kaggle.com\u002Fjsadighian\u002Fcryptorl) 上公开。\n\n\n## 3. 依赖项\n详见 `requirements.txt`\n\n*注意*：为了运行和训练 DQN 智能体（`.\u002Fagent\u002Fdqn.py`），需手动安装 tensorflow 和 Keras-RL，它们未包含在 `requirements.txt` 中，以确保本项目与其他开源强化学习平台（例如 [OpenAI Baselines](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fbaselines)）兼容。\n\n请使用 pip 安装以下依赖：\n\n```\ngit+https:\u002F\u002Fgithub.com\u002Fmanahl\u002Farctic.git\n\nKeras==2.2.4\nKeras-Applications==1.0.7\nKeras-Preprocessing==1.0.9\nkeras-rl==0.4.2\n\ntensorboard==1.13.1\ntensorflow-estimator==1.13.0\ntensorflow-gpu==1.13.1\n```\n\n\n## 4. 项目结构\n本项目的关键组成部分及其简要说明如下：\n```\ncrypto-rl\u002F\n\tagent\u002F\n\t\t\t\t...强化学习算法实现\n\tdata_recorder\u002F\n\t\t\t\t...用于连接、下载和检索限价订单簿数据的工具\n\tgym_trading\u002F\n\t\t\t\t...扩展的 openai.gym 环境，用于观察限价订单簿数据\n\tindicators\u002F\n\t\t\t\t...以 O(1) 时间复杂度实现的技术指标\n\tdesign-patterns\u002F\n\t\t\t\t...模块架构的可视化图表\n\tvenv\u002F\n\t\t\t\t...用于本地部署的虚拟环境\n\texperiment.py          # 运行强化学习实验的入口点\n\trecorder.py            # 开始记录限价订单簿数据的入口点\n\tconfigurations.py      # 项目中使用的常量\n\trequirements.txt       # 项目依赖列表\n\tsetup.py               # 执行命令 `python3 setup.py install` \n\t                       #    以安装扩展的 gym 环境（即 gym_trading.py）\n```\n\n\n## 5. 设计模式\n各模块的设计模式规范请参阅以下文档：\n\n- [限价订单簿、数据记录器与数据库](.\u002Fdata_recorder\u002FREADME.md)\n- [平稳订单簿特征（Stationary LOB Features）](https:\u002F\u002Farxiv.org\u002Fabs\u002F1810.09965v1)\n- [部分可观测马尔可夫决策过程（POMDP）环境](.\u002Fgym_trading\u002FREADME.md)\n- [学习算法与神经网络](.\u002Fagent\u002FREADME.md)\n\n限价订单簿层级的示例快照：\n![plot_lob_levels](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsadighian_crypto-rl_readme_72a4304385ed.png)\n\n订单到达流指标的示例快照：\n![plot_order_arrivals](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsadighian_crypto-rl_readme_e589b5c87dcb.png)\n\n\n## 6. 快速入门\n\n在本地机器上安装本项目：\n```\n# 从 GitHub 克隆项目\ngit clone https:\u002F\u002Fgithub.com\u002Fsadighian\u002Fcrypto-rl.git\ncd crypto-rl\n\n# 为项目依赖创建虚拟环境\npython3 -m venv .\u002Fvenv\n\n# 激活虚拟环境\nsource venv\u002Fbin\u002Factivate\n\n# 安装 keras-rl 依赖\npip3 install Keras==2.2.4 Keras-Applications==1.0.7 Keras-Preprocessing==1.0.9 keras-rl==0.4.2\n tensorboard==1.13.1 tensorflow-estimator==1.13.0 tensorflow-gpu==1.13.1\n \n# 安装数据库依赖\npip3 install git+https:\u002F\u002Fgithub.com\u002Fmanahl\u002Farctic.git\n\n# 安装本项目\npip3 install -e .\n```\n\n### 6.1 从交易所记录限价订单簿数据\n\n**步骤 1：**  \n打开 `configurations.py` 文件，定义你希望订阅并记录的加密货币。\n\n注意：篮子（basket）列表格式如下：`[(Coinbase_Instrument_Name, Bitfinex_Instrument_Name), ...]`\n```\nSNAPSHOT_RATE = 5  # 即每 5 秒记录一次\nBASKET = [('BTC-USD', 'tBTCUSD'),\n         ('ETH-USD', 'tETHUSD'),\n         ('LTC-USD', 'tLTCUSD'),\n         ('BCH-USD', 'tBCHUSD'),\n         ('ETC-USD', 'tETCUSD')]\nRECORD_DATA = True\n```\n\n**步骤 2：**  \n打开命令行终端，执行以下命令开始记录完整的限价订单簿和交易数据：\n ```\n python3 recorder.py\n ```\n\n### 6.2 回放已记录数据以导出平稳特征集\n\n**步骤 1：**  \n确保你的数据库中已有数据。\n\n可通过 MongoDB shell 或 [Compass](https:\u002F\u002Fwww.mongodb.com\u002Fproducts\u002Fcompass) 进行检查。若无数据，请参考上方 **6.1 从交易所记录限价订单簿数据** 部分。\n\n**步骤 2：**  \n运行历史数据模拟，对限价订单簿进行快照，并将其平稳特征导出为压缩的 CSV 文件。\n\n你可以利用 `data_recorder\u002Ftests\u002F` 中的测试用例，或自行编写逻辑。若使用测试用例方法，请确保修改查询参数，使其与你实际记录并存储在数据库中的数据相匹配。\n\n导出特征至压缩 CSV 的示例命令：\n```\npython3 data_recorder\u002Ftests\u002Ftest_extract_features.py\n```\n\n### 6.3 训练智能体\n\n**步骤 1：**  \n确保 `data_recorder\u002Fdatabase\u002Fdata_exports\u002F` 文件夹中已有数据。  \n智能体将从此处加载数据。若该文件夹中无数据，请参考上方 **6.2 回放已记录数据以导出平稳特征集** 部分。\n\n**步骤 2：**  \n打开命令行终端，开始学习\u002F训练智能体：\n```\npython3 experiment.py --window_size=50 --weights=False --fitting_file=...\n```\n所有可用的关键字参数请参阅 `experiment.py` 文件。\n\n\n## 7. 引用本项目\n\n若在研究中使用本项目，请务必引用：\n```\n    @misc{Crypto-RL,\n        author = {Jonathan Sadighian},\n        title = {Deep Reinforcement Learning Toolkit for Cryptocurrencies},\n        year = {2019},\n        publisher = {GitHub},\n        journal = {GitHub repository},\n        howpublished = {\\url{https:\u002F\u002Fgithub.com\u002Fsadighian\u002Fcrypto-rl}},\n    }\n```\n\n\n## 8. 附录\n\n### 8.1 分支（Branches）\n\n本项目包含多个分支，每个分支采用不同的数据持久化实现模式：\n\n- **FULL** 分支旨在作为全自动交易系统的基础（即，实现了适用于需要并行处理的交易系统的设计模式），并将流式 tick 数据持久化到 **Arctic Tick Store**（Arctic Tick 存储）中。\n\n**注意**：以下分支（即 lightweight、order book snapshot、mongo integration）自 2018 年 10 月起已不再积极维护，仅作参考之用。\n\n- **LIGHT WEIGHT** 分支旨在比 __full__ 分支更高效地记录流式数据（即，所有 WebSocket 连接均由单个进程建立，__且__ 不维护限价订单簿（limit order book）），并将流式 tick 数据持久化到 **Arctic tick store** 中。\n- **ORDER BOOK SNAPSHOT** 分支与 __full__ 分支采用相同的设计模式，但不记录流式 tick 数据，而是每隔 **N** 秒对限价订单簿进行一次快照，并将快照持久化到 **Arctic tick store** 中。\n- **MONGO INTEGRATION** 分支的实现与 **ORDER BOOK SNAPSHOT** 相同，不同之处在于使用标准的 MongoDB 而非 Arctic。该分支最初用于对 Arctic 的性能进行基准测试，且未与 **FULL** 分支保持同步更新。\n\n### 8.2 前提假设（Assumptions）\n\n- 你已安装虚拟环境（virtual environment）并将项目安装到该虚拟环境中（例如：`pip3 install -e .`）\n- 你已安装 MongoDB\n- 你知道如何使用命令行界面（CLI）启动 Python 脚本\n- 你正在运行 Ubuntu 18 或更高版本的操作系统\n\n### 8.3 更新日志（Change Log）\n\n- 2021-09-25：更新了 `requirements.txt`：今后数据库需通过 `pip install git+https:\u002F\u002Fgithub.com\u002Fmanahl\u002Farctic.git` 手动安装\n- 2019-12-12：添加了文档字符串（docstrings），并对多个类进行了重构以提升代码可读性\n- 2019-09-18：对 `env`（环境）和 `broker`（经纪商）进行了简化重构，并增加了不同的 `reward`（奖励）方法\n- 2019-09-13：创建并实现了“订单到达”流指标（'order arrival' flow metrics），灵感来源于 Xu, Ke; Gould, Martin D.; Howison, Sam D. 的论文 [Multi-Level Order-Flow Imbalance in a Limit Order Book](https:\u002F\u002Farxiv.org\u002Fabs\u002F1907.06230v1)\n- 2019-09-06：创建并实现了 `Indicator.py` 基类\n- 2019-04-28：为简化结构而重新组织了项目架构","# crypto-rl 快速上手指南\n\n## 环境准备\n\n- **操作系统**：推荐 Ubuntu 18.04 或更高版本（其他 Linux 发行版或 macOS 可能兼容，但未官方测试）\n- **前置依赖**：\n  - Python 3.6+\n  - MongoDB（用于 Arctic 数据库存储）\n  - 虚拟环境支持（`python3-venv`）\n\n> 💡 建议使用国内 PyPI 镜像源（如清华源）加速安装：\n> ```bash\n> pip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple ...\n> ```\n\n## 安装步骤\n\n```bash\n# 克隆项目\ngit clone https:\u002F\u002Fgithub.com\u002Fsadighian\u002Fcrypto-rl.git\ncd crypto-rl\n\n# 创建并激活虚拟环境\npython3 -m venv .\u002Fvenv\nsource venv\u002Fbin\u002Factivate\n\n# 安装核心依赖（推荐使用国内镜像）\npip3 install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple \\\n  Keras==2.2.4 Keras-Applications==1.0.7 Keras-Preprocessing==1.0.9 \\\n  keras-rl==0.4.2 tensorboard==1.13.1 tensorflow-estimator==1.13.0 tensorflow-gpu==1.13.1\n\n# 安装 Arctic 数据库支持\npip3 install git+https:\u002F\u002Fgithub.com\u002Fmanahl\u002Farctic.git\n\n# 安装本项目（以可编辑模式）\npip3 install -e .\n```\n\n> ⚠️ 注意：TensorFlow 1.13 版本较旧，若使用较新 GPU 驱动可能需降级 CUDA\u002FcuDNN，或改用 CPU 版本 `tensorflow==1.13.1`。\n\n## 基本使用\n\n### 1. 录制行情数据\n\n编辑 `configurations.py`，设置要录制的交易对（示例已包含 BTC、ETH 等）：\n\n```python\nBASKET = [('BTC-USD', 'tBTCUSD'),\n         ('ETH-USD', 'tETHUSD')]\nSNAPSHOT_RATE = 5  # 每5秒快照一次\nRECORD_DATA = True\n```\n\n启动录制：\n\n```bash\npython3 recorder.py\n```\n\n> 📌 首次运行前请确保 MongoDB 服务已启动。\n\n### 2. 导出特征数据\n\n从数据库中提取限价订单簿（LOB）特征并保存为压缩 CSV：\n\n```bash\npython3 data_recorder\u002Ftests\u002Ftest_extract_features.py\n```\n\n生成的文件将位于 `data_recorder\u002Fdatabase\u002Fdata_exports\u002F` 目录。\n\n### 3. 训练 DQN 智能体\n\n使用导出的特征数据训练强化学习智能体：\n\n```bash\npython3 experiment.py --window_size=50 --weights=False --fitting_file=\"your_exported_file.csv.gz\"\n```\n\n> 更多参数请参考 `experiment.py` 中的命令行选项。","某量化研究团队希望基于深度强化学习开发一个比特币做市策略，需要利用真实限价订单簿（LOB）数据训练智能体，但缺乏高效的数据回放与训练一体化框架。\n\n### 没有 crypto-rl 时\n- 需手动从 Coinbase Pro 和 Bitfinex 分别拉取原始订单簿快照和逐笔成交数据，格式不统一，清洗耗时。\n- 缺乏标准化的回放机制，难以将历史订单流还原为连续、低延迟的市场状态供模型训练。\n- 自行构建 OpenAI Gym 环境来模拟交易过程，状态空间设计粗糙，无法有效捕捉订单簿动态特征。\n- 技术指标计算效率低，在高频回测中成为性能瓶颈。\n- 训练 DDQN 智能体时需从零搭建神经网络与经验回放模块，复现论文结果困难且易出错。\n\n### 使用 crypto-rl 后\n- 通过内置 recorder.py 一键录制多交易所全深度订单簿数据，并自动存入 Arctic 时间序列数据库，结构清晰、查询高效。\n- 利用 gym_trading 模块提供的 POMDP 环境，可高保真回放历史订单流，生成 O(1) 复杂度的平稳特征（如价格压力、订单不平衡度）。\n- 直接调用预置的 DDQN 实现（agent\u002Fdqn.py），快速复现《Deep Reinforcement Learning for Market Making》等论文实验。\n- 内置高性能技术指标库，支持实时特征提取，显著提升训练吞吐量。\n- 整个“记录—回放—训练”流程标准化，团队成员可快速迭代策略，无需重复造轮子。\n\ncrypto-rl 将加密货币订单簿数据处理与强化学习训练无缝衔接，大幅降低量化研究门槛并提升实验可复现性。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsadighian_crypto-rl_72a43043.png","sadighian","Jonathan Sadighian","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fsadighian_47d1c573.png","Machine learning engineer",null,"Norfolk, VA","jonathan.m.sadighian@gmail.com","https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fjonathansadighian\u002F","https:\u002F\u002Fgithub.com\u002Fsadighian",[85],{"name":86,"color":87,"percentage":88},"Python","#3572A5",100,946,241,"2026-04-04T03:50:56",4,"Linux","需要 NVIDIA GPU（因依赖 tensorflow-gpu==1.13.1），但未说明具体型号、显存大小和 CUDA 版本","未说明",{"notes":97,"python":98,"dependencies":99},"项目仅用于研究，不支持实盘交易；需手动安装 Arctic 数据库和 TensorFlow 相关依赖；需预先安装 MongoDB；推荐使用 Ubuntu 18+ 系统；虚拟环境建议使用 venv。","3.x（根据 python3 命令推断，未明确具体版本）",[100,101,102,103,104],"Keras==2.2.4","keras-rl==0.4.2","tensorflow-gpu==1.13.1","arctic (from git)","MongoDB",[14],[107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126],"bitfinex","multiprocessing","mongodb","orderbook","tick-data","order-book","limit-order-book","hft","multithreading","recorder","arctic","tickstore","coinbase-pro","coinbase","deep-reinforcement-learning","dqn","cryptocurrencies","trading","trading-algorithms","bitcoin",5,"2026-03-27T02:49:30.150509","2026-04-06T08:52:40.294179",[131,136,141,146,151,156],{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},253,"为什么记录器会陷入“无休止的预热”状态？","这通常是由于日志输出误导造成的。实际上数据库仍在接收和存储数据，但日志错误地显示某个交易所（如 Bitfinex）仍在预热。维护者已在提交 a1cdc2b0534c8a208e86f4013eb8161998d97ac6 中修复了该日志问题。此外，Bitfinex 不需要像 Coinbase 那样调用 load_book()，因为它在 WebSocket 连接建立时会自动发送初始订单簿快照。","https:\u002F\u002Fgithub.com\u002Fsadighian\u002Fcrypto-rl\u002Fissues\u002F19",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},254,"test_extract_features.py 文件在哪里？","该测试方法并未单独成文件，而是实现在 data_recorder\u002Ftests\u002Ftest_simulator.py 中的 test_extract_features() 函数里（见第 51–72 行）。README 已更新以反映正确的文件名。","https:\u002F\u002Fgithub.com\u002Fsadighian\u002Fcrypto-rl\u002Fissues\u002F13",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},255,"项目支持哪些 Python 版本？","项目最初使用 Python 3.6 开发，官方确认在 Ubuntu 20+ 上使用 Python 3.8 可正常运行。部分依赖（如 Arctic 和 TensorFlow 1.x）在 Python 3.6.x 上兼容性更好，建议优先尝试该版本。","https:\u002F\u002Fgithub.com\u002Fsadighian\u002Fcrypto-rl\u002Fissues\u002F24",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},256,"如何导出多天的训练数据而不导致内存溢出（OOM）？","建议将历史数据分批回放，每批处理 1–4 天的数据（具体取决于交易活跃度和硬件配置）。simulator.extract_features() 方法支持按天分割数据。由于 Arctic TickStore 使用扁平字典列表实现高压缩比，加载整月数据可能消耗大量内存（如 10GB），因此应避免一次性加载过多数据。","https:\u002F\u002Fgithub.com\u002Fsadighian\u002Fcrypto-rl\u002Fissues\u002F20",{"id":152,"question_zh":153,"answer_zh":154,"source_url":155},257,"项目中为何没有 ppo.py、a2c.py 等强化学习算法文件？","该项目并非论文的完整源码，而是一个用于加速强化学习研究的平台，已集成数据采集功能。提供的 dqn.py 仅作为“Hello World”示例，展示如何将 RL 算法与平台集成。若需实现 PPO、A2C 或 ACER，可参考 dqn.py 的结构自行扩展。","https:\u002F\u002Fgithub.com\u002Fsadighian\u002Fcrypto-rl\u002Fissues\u002F17",{"id":157,"question_zh":158,"answer_zh":159,"source_url":160},258,"在 M1 Mac 或 Docker 中运行 recorder.py 时遇到 WebSocket ConnectionRefusedError 怎么办？","虽然 Issue 中未给出明确解决方案，但该错误通常与网络连接或 WebSocket 服务端限制有关。建议检查防火墙设置、代理配置，或尝试更换网络环境。同时确保使用的 Python 依赖版本（如 websockets 库）与系统架构（如 ARM64）兼容。","https:\u002F\u002Fgithub.com\u002Fsadighian\u002Fcrypto-rl\u002Fissues\u002F30",[]]