[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"tool-tradytics--surpriver":3,"similar-tradytics--surpriver":103},{"id":4,"github_repo":5,"name":6,"description_en":7,"description_zh":8,"ai_summary_zh":8,"readme_en":9,"readme_zh":10,"quickstart_zh":11,"use_case_zh":12,"hero_image_url":13,"owner_login":14,"owner_name":15,"owner_avatar_url":16,"owner_bio":17,"owner_company":15,"owner_location":18,"owner_email":19,"owner_twitter":14,"owner_website":20,"owner_url":21,"languages":22,"stars":35,"forks":36,"last_commit_at":37,"license":38,"difficulty_score":39,"env_os":40,"env_gpu":41,"env_ram":41,"env_deps":42,"category_tags":53,"github_topics":57,"view_count":39,"oss_zip_url":19,"oss_zip_packed_at":19,"status":68,"created_at":69,"updated_at":70,"faqs":71,"releases":102},6088,"tradytics\u002Fsurpriver","surpriver","Find big moving stocks before they move using machine learning and anomaly detection","Surpriver 是一款利用机器学习和异常检测技术，旨在帮助投资者在股价大幅波动前识别潜在目标的开源工具。它通过分析股票的交易量与价格行为，智能推断出偏离常态的特殊模式，从而捕捉那些即将出现剧烈行情的标的，解决了传统方法难以提前发现隐蔽市场异动的痛点。\n\n这款工具特别适合具备一定编程基础的量化交易开发者、金融数据研究人员以及希望探索算法选股策略的进阶投资者使用。用户只需配置简单的命令行参数，即可从雅虎财经获取数据，快速筛选出当前市场中异常评分最高的股票列表。\n\nSurpriver 的技术亮点在于其灵活的数据处理能力：支持从 1 分钟到 60 分钟多种时间粒度的 K 线分析，允许用户自定义历史回溯周期和最低成交量门槛。此外，它还提供了数据字典缓存机制，避免重复下载数据，显著提升了回测与实时监测的效率。结合 Scikit-learn、Pandas 及 TA-Lib 等成熟库，Surpriver 为构建个性化的量化预警系统提供了一个轻量且可扩展的基础框架。","\u003Cp align=\"center\">\n  \u003Cimg width=\"350\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftradytics_surpriver_readme_ecb955c2ce4f.png\">\n\u003C\u002Fp>\n\n# Surpriver - Find High Moving Stocks before they Move\nFind high moving stocks before they move using anomaly detection and machine learning. Surpriver uses machine learning to look at volume + price action and infer unusual patterns which can result in big moves in stocks.\n\n### Files Description\n| Path | Description\n| :--- | :----------\n| surpriver | Main folder.\n| &boxur;&nbsp; dictionaries | Folder to save data dictionaries for later use. \n| &boxur;&nbsp; figures | Figures for this github repositories.\n| &boxur;&nbsp; stocks | List of all the stocks that you want to analyze.\n| data_loader.py | Module for loading data from yahoo finance.\n| detection_engine.py | Main module for running anomaly detection on data and finding stocks with most unusual price and volume patterns.\n| feature_generator.py | Generates price and volume return features as well as plenty of technical indicators.\n\n## Usage\n### Packages\nYou will need to install the following package to train and test the models.\n- [Scikit-learn](https:\u002F\u002Fscikit-learn.org\u002F)\n- [Numpy](https:\u002F\u002Fnumpy.org\u002F)\n- [Tqdm](https:\u002F\u002Fgithub.com\u002Ftqdm\u002Ftqdm)\n- [Yfinance](https:\u002F\u002Fgithub.com\u002Franaroussi\u002Fyfinance)\n- [Pandas](https:\u002F\u002Fpandas.pydata.org\u002F)\n- [Scipy](https:\u002F\u002Fwww.scipy.org\u002Finstall.html)\n- [Ta](https:\u002F\u002Fgithub.com\u002Fbukosabino\u002Fta)\n\nYou can install all packages using the following command. Please note that the script was written using python3.\n```\npip install -r requirements.txt\n```\n\n## Running with Docker\nYou can also use docker if you know what it is and have some knowledge on how to use it. Here are the steps to run the tool with docker.\n\n- First you must build the container: `docker build . -t surpriver`\n- Then you need to copy the contents of docker-compose.yml.template to a new file called docker-compose.yml\n- Replace `\u003CC:\\\\path\\\\to\\\\this\\\\dir>` with the directory you are working in.\n- Run the container by executing `docker-compose up -d`\n- Execute any of the commands below by prepending `docker exec -it surpriver` to your command line.\n\n### Predictions for Today\nIf you want to go ahead and directly get the most anomalous stocks for today, you can simple run the following command to get the stocks with the most unusual patterns. We will dive deeper into the command in the following sections.\n\n#### Get Most Anomalous Stocks for Today\n##### When you do not have the data dictionary saved and you are running it for the first time.\n```\npython detection_engine.py --top_n 25 --min_volume 5000 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 0 --data_dictionary_path 'dictionaries\u002Fdata_dict.npy' --is_save_dictionary 1 --is_test 0 --future_bars 0\n```\nThis command will give you the top **25 stocks** that had the highest anomaly score in the last **14 bars** of **60 minute candles**. It will also store all the data that it used to make predictions in the **dictionaries\u002Fdata_dict.npy** folder. Below is a more detailed explanation of each parameter.\n- **top_n**: The total number of most anomalous stocks you want to see.\n- **min_volume**: Filter for volume. Any stock that has an average of volume lower than this value will be ignored.\n- **data_granularity_minutes**: Data granularity to use for analysis. The available options are *1min, 5min, 15min, 30min, 60min*.\n- **history_to_use**: Historical bars to use to analyze the unusual and anomalous patterns.\n- **is_save_dictionary**: Whether to save the stock data that is used for analysis in a dictionary or not. Enabling this would save you time if you want to do some further analysis on the data.\n- **data_dictionary_path**: Dictionary path where data would be stored.\n- **is_load_from_dictionary**: Whether to load the data from dictionary or download it from yahoo finance directly. You can use the dictionary you saved above here for multiple runs.\n- **is_test**: You can actually test the predictions by leaving some of the recent data as future data and analyzing whether the most anomalous stocks moved the most after their predictions. If this value is 1, the value of **future_bars** should be greater than 5.\n- **future_bars**: These number of bars will be saved from the recent history for testing purposes.\n- **output_format**: The format for results. If you pass CLI, the results will be printed to the console. If you pass JSON, a JSON file will be created with results for today's date. The default is CLI.\n\n#####  When you have the data dictionary saved, you can just run the following command.\n```\npython detection_engine.py --top_n 25 --min_volume 5000 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 1 --data_dictionary_path 'dictionaries\u002Fdata_dict.npy' --is_save_dictionary 0 --is_test 0 --future_bars 0 --output_format 'CLI'\n```\nNotice the change in **is_save_dictionary** and **is_load_from_dictionary**.\n\nHere is an output of how a single prediction looks like. **Please note that negative scores indicate higher anomalous and unusual patterns while positive scores indicate normal patterns. The lower the better**.\n\n```\nLast Bar Time: 2020-08-25 11:30:00-04:00\nSymbol: SPI\nAnomaly Score: -0.029\nToday Volume (Today = Date Above): 313.94K\nAverage Volume 5d: 206.53K\nAverage Volume 20d: 334.14K\nVolatility 5bars: 0.013\nVolatility 20bars: 0.038\nFuture Absolute Sum Price Changes: 72.87\n```\n\n### Test on Historical Data\nIf you are suspicious of the use of Machine Learning and Artificial Intelligence in trading, you can actually test the predictions from this tool on historical data. The two most important command line arguments for testing are **is_test** and **future_bars**. If the former one is set to 1 and the later one is set to anything more than 5, the tool will actually leave that amount of data for analysis purposes and use the data prior to that for anomalous predictions. Next, it will look at that remaining data to see how well the predictions did. Here is an example of a scatter plot from the following command.\n\n#### Find Anomalous Stocks and Test them on Historical Data\n```\npython detection_engine.py --top_n 25 --min_volume 5000 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 0 --data_dictionary_path 'dictionaries\u002Fdata_dict.npy' --is_save_dictionary 1 --is_test 1 --future_bars 25\n```\n\nIf you have already generated the data dictionary, you can use the following command where we set **is_load_from_dictionary** to 1 and **is_save_dictionary** to 0.\n```\npython detection_engine.py --top_n 25 --min_volume 5000 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 1 --data_dictionary_path 'dictionaries\u002Fdata_dict.npy' --is_save_dictionary 0 --is_test 1 --future_bars 25\n```\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftradytics_surpriver_readme_901a6e54c33f.png\">\n\u003C\u002Fp>\n\nAs you can see in the image above, the anomalous stocks (score \u003C 0) usually have a higher absolute change in the future on average. That proves that the predictions are actually for those stocks that moved more than average in the next few hours\u002Fdays. One question arises here, what if the tool is just picking the highest volatility stocks because those would yield high future absolute change. In order to prove that it's not the case, here is the more detailed description of stats you get from the above command.\n```\n--> Future Performance\nCorrelation between future absolute change vs anomalous score (lower is better, range = (-1, 1)): **-0.23**\nTotal absolute change in future for Anomalous Stocks: **89.660**\nTotal absolute change in future for Normal Stocks: **43.000**\nAverage future volatility of Anomalous Stocks: **0.332**\nAverage future volatility of Normal Stocks: **0.585**\nHistorical volatility for Anomalous Stocks: **2.528**\nHistorical volatility for Normal Stocks: **2.076**\n```\n\nYou can see that historical volatility for normal vs anomalous stocks is not that different. However, the difference in total absolute future change is double for anomalous stocks as compared to normal stocks. \n\n### Support for Crypto Currencies\nYou can now specify which data source you wold like to use along with which stocks list you would like to use.\n```\npython detection_engine.py --top_n 25 --min_volume 500 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 0 --data_dictionary_path 'dictionaries\u002Ffeature_dict.npy' --is_save_dictionary 1 --is_test 0 --future_bars 0  --data_source binance --stock_list cryptos.txt\n```\n- **data_source**: Specifies where to get data from, current supported options are binance and yahoo_finance(default)\n- **stocks_list**: Which file in the stocks directory contains the list of tickers to analyze. Default is stocks.txt.\n### Results\nWe will try to post the top 25 results for a single set of parameters every week.\n##### August 31, 2020 to September 05, 2020: https:\u002F\u002Fpastebin.com\u002FL5T2BYUx\n\n### Limitations\nThe tool only finds stocks that have some unusual behavior in their price and volume action combined. It does not predict which direction the stock is going to move. That might be a feature that I'll implement in the future but for right now, you'll need to look at the charts and do your DD to figure that out.\n\n## License\n[![License: GPL v3](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-GPLv3-blue.svg)](https:\u002F\u002Fwww.gnu.org\u002Flicenses\u002Fgpl-3.0)\n\nA product by [Tradytics](https:\u002F\u002Fwww.tradytics.com\u002F)\n\nCopyright (c) 2020-present, Tradytics.com\n\n","\u003Cp align=\"center\">\n  \u003Cimg width=\"350\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftradytics_surpriver_readme_ecb955c2ce4f.png\">\n\u003C\u002Fp>\n\n# Surpriver - 在股票大幅波动前发现高动量个股\n利用异常检测和机器学习技术，在股票价格出现大幅波动之前，提前识别出高动量个股。Surpriver 通过机器学习分析成交量与价格走势，挖掘可能引发股价大幅波动的异常模式。\n\n### 文件说明\n| 路径 | 描述\n| :--- | :----------\n| surpriver | 主文件夹。\n| &boxur;&nbsp; dictionaries | 用于保存数据字典以便后续使用的文件夹。\n| &boxur;&nbsp; figures | 本 GitHub 仓库中的图表文件。\n| &boxur;&nbsp; stocks | 您希望分析的所有股票列表。\n| data_loader.py | 从 Yahoo Finance 加载数据的模块。\n| detection_engine.py | 主要模块，用于对数据进行异常检测，并找出价格和成交量模式最异常的股票。\n| feature_generator.py | 生成价格和成交量收益率特征以及大量技术指标。\n\n## 使用方法\n### 依赖包\n您需要安装以下软件包来训练和测试模型：\n- [Scikit-learn](https:\u002F\u002Fscikit-learn.org\u002F)\n- [Numpy](https:\u002F\u002Fnumpy.org\u002F)\n- [Tqdm](https:\u002F\u002Fgithub.com\u002Ftqdm\u002Ftqdm)\n- [Yfinance](https:\u002F\u002Fgithub.com\u002Franaroussi\u002Fyfinance)\n- [Pandas](https:\u002F\u002Fpandas.pydata.org\u002F)\n- [Scipy](https:\u002F\u002Fwww.scipy.org\u002Finstall.html)\n- [Ta](https:\u002F\u002Fgithub.com\u002Fbukosabino\u002Fta)\n\n您可以使用以下命令一次性安装所有依赖包。请注意，该脚本是基于 Python 3 编写的。\n```\npip install -r requirements.txt\n```\n\n## 使用 Docker 运行\n如果您熟悉 Docker 并了解其使用方法，也可以选择使用 Docker 来运行本工具。以下是使用 Docker 运行该工具的步骤：\n\n- 首先构建容器：`docker build . -t surpriver`\n- 然后将 `docker-compose.yml.template` 文件复制为新的 `docker-compose.yml` 文件。\n- 将 `\u003CC:\\\\path\\\\to\\\\this\\\\dir>` 替换为您当前的工作目录。\n- 启动容器：`docker-compose up -d`\n- 在执行以下任何命令时，请在命令前加上 `docker exec -it surpriver`。\n\n### 今日预测结果\n如果您想直接获取今日最异常的股票，只需运行以下命令即可得到具有最异常模式的股票列表。我们将在后续章节中更详细地介绍该命令。\n\n#### 获取今日最异常的股票\n##### 当您尚未保存数据字典且首次运行时：\n```\npython detection_engine.py --top_n 25 --min_volume 5000 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 0 --data_dictionary_path 'dictionaries\u002Fdata_dict.npy' --is_save_dictionary 1 --is_test 0 --future_bars 0\n```\n此命令将为您提供在过去 **14 根** **60 分钟 K 线** 中异常得分最高的 **25 只股票**。同时，它会将用于预测的所有数据存储到 **dictionaries\u002Fdata_dict.npy** 文件中。以下是各参数的详细说明：\n- **top_n**：您希望查看的最异常股票总数。\n- **min_volume**：成交量过滤条件。平均成交量低于此值的股票将被忽略。\n- **data_granularity_minutes**：用于分析的数据粒度。可选值包括 *1 分钟、5 分钟、15 分钟、30 分钟、60 分钟*。\n- **history_to_use**：用于分析异常模式的历史 K 线数量。\n- **is_save_dictionary**：是否将用于分析的股票数据保存为字典。启用此选项可以在后续进一步分析数据时节省时间。\n- **data_dictionary_path**：数据字典的保存路径。\n- **is_load_from_dictionary**：是从数据字典加载数据，还是直接从 Yahoo Finance 下载数据。您可以在此处使用之前保存的数据字典进行多次运行。\n- **is_test**：您可以通过保留部分近期数据作为未来数据，来测试预测的准确性，即观察预测出的最异常股票在未来是否确实出现了较大波动。如果此值为 1，则 **future_bars** 的值应大于 5。\n- **future_bars**：从近期历史数据中保留一定数量的 K 线用于测试。\n- **output_format**：结果输出格式。如果选择 CLI，结果将打印到控制台；如果选择 JSON，则会生成一个包含当日结果的 JSON 文件。默认为 CLI。\n\n##### 当您已保存数据字典时，只需运行以下命令：\n```\npython detection_engine.py --top_n 25 --min_volume 5000 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 1 --data_dictionary_path 'dictionaries\u002Fdata_dict.npy' --is_save_dictionary 0 --is_test 0 --future_bars 0 --output_format 'CLI'\n```\n请注意 **is_save_dictionary** 和 **is_load_from_dictionary** 参数的变化。\n\n以下是一个单次预测结果的示例。**请注意，负分表示更高的异常和不寻常模式，而正分则表示正常模式。分数越低越好**。\n\n```\n最后一根 K 线时间：2020-08-25 11:30:00-04:00\n股票代码：SPI\n异常得分：-0.029\n今日成交量（今日指上述日期）：313.94K\n过去 5 天平均成交量：206.53K\n过去 20 天平均成交量：334.14K\n过去 5 根 K 线波动率：0.013\n过去 20 根 K 线波动率：0.038\n未来绝对价格变动总和：72.87\n```\n\n### 历史数据测试\n如果你对在交易中使用机器学习和人工智能持怀疑态度，实际上你可以用历史数据来测试该工具的预测结果。用于测试的两个最重要的命令行参数是 **is_test** 和 **future_bars**。如果将前者设置为 1，并将后者设置为大于 5 的值，那么该工具会留出相应数量的数据用于分析，并利用这些数据之前的记录来进行异常检测预测。随后，它会查看剩余的数据，以评估预测的效果如何。以下是根据以下命令生成的散点图示例。\n\n#### 查找异常股票并在历史数据上进行测试\n```\npython detection_engine.py --top_n 25 --min_volume 5000 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 0 --data_dictionary_path 'dictionaries\u002Fdata_dict.npy' --is_save_dictionary 1 --is_test 1 --future_bars 25\n```\n\n如果你已经生成了数据字典，可以使用以下命令，其中我们将 **is_load_from_dictionary** 设置为 1，而 **is_save_dictionary** 设置为 0。\n```\npython detection_engine.py --top_n 25 --min_volume 5000 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 1 --data_dictionary_path 'dictionaries\u002Fdata_dict.npy' --is_save_dictionary 0 --is_test 1 --future_bars 25\n```\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftradytics_surpriver_readme_901a6e54c33f.png\">\n\u003C\u002Fp>\n\n如上图所示，异常股票（得分 \u003C 0）在未来平均而言往往具有更高的绝对涨跌幅。这证明了该工具的预测确实针对那些在未来几小时\u002F几天内波动幅度高于平均水平的股票。这里有一个问题：会不会是因为该工具只是挑选出了波动性最高的股票，而这类股票自然会在未来产生较大的绝对涨跌幅呢？为了证明并非如此，以下是上述命令所得到的更详细统计信息：\n```\n--> 未来表现\n未来绝对涨跌幅与异常分数之间的相关系数（越低越好，范围为 (-1, 1)）：**-0.23**\n异常股票未来的总绝对涨跌幅：**89.660**\n正常股票未来的总绝对涨跌幅：**43.000**\n异常股票的未来平均波动率：**0.332**\n正常股票的未来平均波动率：**0.585**\n异常股票的历史波动率：**2.528**\n正常股票的历史波动率：**2.076**\n```\n\n可以看出，正常股票与异常股票的历史波动率相差并不大。然而，异常股票的未来总绝对涨跌幅却是正常股票的两倍。\n\n### 对加密货币的支持\n现在你可以指定要使用的数据源以及对应的股票列表。\n```\npython detection_engine.py --top_n 25 --min_volume 500 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 0 --data_dictionary_path 'dictionaries\u002Ffeature_dict.npy' --is_save_dictionary 1 --is_test 0 --future_bars 0  --data_source binance --stock_list cryptos.txt\n```\n- **data_source**：指定从哪里获取数据，目前支持的选项有 binance 和 yahoo_finance（默认）。\n- **stocks_list**：stocks 目录下哪个文件包含待分析的股票代码列表。默认为 stocks.txt。\n\n### 结果\n我们将每周发布一组参数下的前 25 名结果。\n##### 2020年8月31日至9月5日：https:\u002F\u002Fpastebin.com\u002FL5T2BYUx\n\n### 局限性\n该工具仅能发现价格和成交量组合行为异常的股票，而无法预测股票的具体走势方向。这可能是我未来会实现的功能，但目前你仍需结合图表并进行自己的基本面和技术面分析来判断股价走向。\n\n## 许可证\n[![License: GPL v3](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-GPLv3-blue.svg)](https:\u002F\u002Fwww.gnu.org\u002Flicenses\u002Fgpl-3.0)\n\n由 [Tradytics](https:\u002F\u002Fwww.tradytics.com\u002F) 制作\n\n版权所有 © 2020 至今，Tradytics.com","# Surpriver 快速上手指南\n\nSurpriver 是一个利用异常检测和机器学习技术，通过分析成交量与价格行为来识别潜在大幅波动股票的开源工具。它能帮助你在股价大幅变动前发现异常模式。\n\n## 环境准备\n\n### 系统要求\n- **操作系统**：Linux, macOS 或 Windows\n- **Python 版本**：Python 3.x (推荐 Python 3.8+)\n- **可选容器化**：Docker & Docker Compose (如果你偏好容器化部署)\n\n### 前置依赖\n本项目依赖以下 Python 库：\n- Scikit-learn\n- Numpy\n- Tqdm\n- Yfinance (用于获取雅虎财经数据)\n- Pandas\n- Scipy\n- Ta (技术分析指标库)\n\n> **国内加速建议**：在安装依赖时，建议使用国内镜像源（如清华源或阿里源）以提升下载速度。\n\n## 安装步骤\n\n### 方式一：直接安装 (推荐)\n\n1. 克隆项目代码到本地。\n2. 进入项目目录，使用 pip 安装依赖。\n\n```bash\n# 使用国内镜像源安装依赖\npip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n### 方式二：使用 Docker\n\n如果你熟悉 Docker，可以使用容器化运行：\n\n1. **构建镜像**：\n   ```bash\n   docker build . -t surpriver\n   ```\n\n2. **配置 compose 文件**：\n   将 `docker-compose.yml.template` 复制为 `docker-compose.yml`，并修改其中的路径占位符 `\u003CC:\\\\path\\\\to\\\\this\\\\dir>` 为你当前的工作目录绝对路径。\n\n3. **启动容器**：\n   ```bash\n   docker-compose up -d\n   ```\n   *注：后续运行命令时，需在命令前加上 `docker exec -it surpriver`。*\n\n## 基本使用\n\n### 获取今日最异常的股票\n\n这是最常用的场景：扫描市场，找出过去一段时间内价格和成交量模式最异常的前 N 只股票。\n\n#### 场景 A：首次运行（无缓存数据）\n该命令会从 Yahoo Finance 下载数据，进行分析，并将数据字典保存到本地以便下次复用。\n\n```bash\npython detection_engine.py --top_n 25 --min_volume 5000 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 0 --data_dictionary_path 'dictionaries\u002Fdata_dict.npy' --is_save_dictionary 1 --is_test 0 --future_bars 0\n```\n\n**参数解读：**\n- `--top_n 25`: 返回异常得分最高的 25 只股票。\n- `--min_volume 5000`: 过滤掉平均成交量低于 5000 的股票。\n- `--data_granularity_minutes 60`: 使用 60 分钟 K 线数据进行分析 (可选: 1, 5, 15, 30, 60)。\n- `--history_to_use 14`: 分析最近 14 根 K 线的历史数据。\n- `--is_save_dictionary 1`: 保存处理后的数据字典，加速后续运行。\n\n#### 场景 B：已有缓存数据（快速运行）\n如果你已经运行过上述命令并生成了 `data_dict.npy`，可以直接加载数据进行快速预测：\n\n```bash\npython detection_engine.py --top_n 25 --min_volume 5000 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 1 --data_dictionary_path 'dictionaries\u002Fdata_dict.npy' --is_save_dictionary 0 --is_test 0 --future_bars 0 --output_format 'CLI'\n```\n\n### 结果解读\n\n运行成功后，终端将输出类似以下的信息：\n\n```text\nLast Bar Time: 2020-08-25 11:30:00-04:00\nSymbol: SPI\nAnomaly Score: -0.029\nToday Volume (Today = Date Above): 313.94K\nAverage Volume 5d: 206.53K\n...\nFuture Absolute Sum Price Changes: 72.87\n```\n\n**关键点说明：**\n- **Anomaly Score (异常得分)**：**分数越低（负值越大），表示异常程度越高**。正数通常代表正常模式。\n- **功能限制**：该工具仅识别“异常波动”，**不预测涨跌方向**。你需要结合图表和其他基本面分析（DD）来判断是做多还是做空。\n\n### 进阶：加密货币支持\n\nSurpriver 也支持加密货币数据（需指定数据源和代币列表）：\n\n```bash\npython detection_engine.py --top_n 25 --min_volume 500 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 0 --data_dictionary_path 'dictionaries\u002Ffeature_dict.npy' --is_save_dictionary 1 --is_test 0 --future_bars 0  --data_source binance --stock_list cryptos.txt\n```","某量化交易团队需要在每日开盘前快速从数千只股票中筛选出即将出现剧烈波动的标的，以制定日内短线策略。\n\n### 没有 surpriver 时\n- 分析师只能依赖传统技术指标或人工复盘，难以从海量数据中识别出隐蔽的量价异常模式。\n- 面对全市场股票，缺乏高效的自动化筛选机制，往往等到股价已经大幅拉升后才后知后觉地发现问题。\n- 手动处理分钟级历史数据耗时费力，无法灵活调整时间粒度（如 60 分钟 K 线）进行多维度回测验证。\n- 容易受到市场噪音干扰，误判普通波动为突破信号，导致策略胜率低且回撤风险大。\n\n### 使用 surpriver 后\n- 利用机器学习算法自动分析量价关系，精准捕捉人类难以察觉的异常模式，提前锁定潜在爆发股。\n- 通过一行命令即可扫描全市场，直接输出得分最高的前 25 只异常股票，将数小时的工作压缩至几分钟。\n- 支持自定义数据粒度（如 60 分钟）和历史窗口（如过去 14 根 K 线），并能缓存数据字典以便快速重复测试不同参数。\n- 基于统计学的异常检测机制有效过滤市场噪音，显著提升了信号的信噪比和交易策略的盈亏比。\n\nsurpriver 将被动跟随行情转变为主动预判异动，帮助交易者在市场大幅波动前抢占先机。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftradytics_surpriver_901a6e54.png","tradytics","Tradytics","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Ftradytics_97a523e7.png","Artificial Intelligence driven Trading Tools","Preston, UK",null,"tradytics.com\u002F","https:\u002F\u002Fgithub.com\u002Ftradytics",[23,27,31],{"name":24,"color":25,"percentage":26},"Python","#3572A5",99.7,{"name":28,"color":29,"percentage":30},"Batchfile","#C1F12E",0.2,{"name":32,"color":33,"percentage":34},"Shell","#89e051",0.1,1858,336,"2026-04-09T07:50:10","GPL-3.0",2,"Linux, macOS, Windows","未说明",{"notes":43,"python":44,"dependencies":45},"支持通过 Docker 运行；默认数据源为 Yahoo Finance，也支持 Binance（加密货币）；工具仅检测异常模式，不预测涨跌方向；首次运行可设置保存数据字典以加速后续分析。","Python 3",[46,47,48,49,50,51,52],"scikit-learn","numpy","tqdm","yfinance","pandas","scipy","ta",[54,55,56],"Agent","开发框架","图像",[58,59,60,61,62,63,64,65,66,67],"machine-learning","finance-application","trading","trading-algorithms","algotrading","anomaly-detection","ai","investment","stock-analysis","stock","ready","2026-03-27T02:49:30.150509","2026-04-10T11:25:20.653899",[72,77,82,87,92,97],{"id":73,"question_zh":74,"answer_zh":75,"source_url":76},27586,"运行程序时出现 JSON 解码错误（JSONDecodeError），导致无法加载股票数据，如何解决？","该问题通常由 yfinance 库的旧版本引起。请将 yfinance 升级到 0.1.63 或更高版本即可解决。可以使用命令：pip install --upgrade yfinance==0.1.63。","https:\u002F\u002Fgithub.com\u002Ftradytics\u002Fsurpriver\u002Fissues\u002F24",{"id":78,"question_zh":79,"answer_zh":80,"source_url":81},27587,"使用 Docker Compose 启动时遇到 'permission denied' 错误，提示无法执行 entry_point.sh，怎么办？","这是因为 entry_point.sh 文件缺少可执行权限。请在运行 docker-compose 之前，在项目目录下执行命令：chmod +x entry_point.sh，赋予其执行权限后重试。","https:\u002F\u002Fgithub.com\u002Ftradytics\u002Fsurpriver\u002Fissues\u002F23",{"id":83,"question_zh":84,"answer_zh":85,"source_url":86},27588,"运行时提示找不到文件或目录 'dictionaries\u002Fdata_dict.npy'，该如何修复命令行参数？","这是因为命令行参数中路径的引号使用不当。请移除 --data_dictionary_path 参数值周围的单引号。将命令中的 '--data_dictionary_path 'dictionaries\u002Fdata_dict.npy'' 修改为 '--data_dictionary_path dictionaries\u002Fdata_dict.npy' 即可。","https:\u002F\u002Fgithub.com\u002Ftradytics\u002Fsurpriver\u002Fissues\u002F5",{"id":88,"question_zh":89,"answer_zh":90,"source_url":91},27589,"如何在 Docker 环境中正确配置环境变量以挂载配置文件？","在运行 Docker 容器时，需要设置 CONFIG 环境变量来映射本地配置目录。例如：CONFIG=\"C:\\path\\to\\this\\dir:\u002Fusr\u002Fsrc\u002Fapp\u002F\"。这确保了容器可以访问宿主机上的配置文件目录。","https:\u002F\u002Fgithub.com\u002Ftradytics\u002Fsurpriver\u002Fissues\u002F11",{"id":93,"question_zh":94,"answer_zh":95,"source_url":96},27590,"安装依赖时遇到 Python requirements 报错或 pkg-resources 相关问题，如何处理？","该问题通常源于依赖冲突或环境配置错误。建议创建一个新的虚拟环境（特别是在 Windows 上），重新安装 requirements.txt 中的依赖。维护者已提交修复补丁（PR #16），拉取最新代码通常也能解决此问题。","https:\u002F\u002Fgithub.com\u002Ftradytics\u002Fsurpriver\u002Fissues\u002F15",{"id":98,"question_zh":99,"answer_zh":100,"source_url":101},27591,"发现 stocks.txt 文件中包含已退市（delisted）的股票代码，会导致运行错误吗？","是的，包含已退市的股票代码可能导致数据获取失败。用户应检查并移除这些代码。社区成员已提供清理后的文件，建议向项目提交 Pull Request 以更新官方的 stocks.txt 列表，或直接使用社区提供的无退市股票的文件。","https:\u002F\u002Fgithub.com\u002Ftradytics\u002Fsurpriver\u002Fissues\u002F4",[],[104,114,122,131,139,148],{"id":105,"name":106,"github_repo":107,"description_zh":108,"stars":109,"difficulty_score":110,"last_commit_at":111,"category_tags":112,"status":68},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",[54,55,56,113],"数据工具",{"id":115,"name":116,"github_repo":117,"description_zh":118,"stars":119,"difficulty_score":110,"last_commit_at":120,"category_tags":121,"status":68},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",[55,56,54],{"id":123,"name":124,"github_repo":125,"description_zh":126,"stars":127,"difficulty_score":39,"last_commit_at":128,"category_tags":129,"status":68},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 真正成长为懂上",148568,"2026-04-09T23:34:24",[55,54,130],"语言模型",{"id":132,"name":133,"github_repo":134,"description_zh":135,"stars":136,"difficulty_score":39,"last_commit_at":137,"category_tags":138,"status":68},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",[55,56,54],{"id":140,"name":141,"github_repo":142,"description_zh":143,"stars":144,"difficulty_score":39,"last_commit_at":145,"category_tags":146,"status":68},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[147,54,56,55],"插件",{"id":149,"name":150,"github_repo":151,"description_zh":152,"stars":153,"difficulty_score":39,"last_commit_at":154,"category_tags":155,"status":68},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",[147,55]]