npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

xuexue-ai-scan

v1.2.5

Published

雪雪AI 本地交易系统(单面板综合交易):行情扫描 / 技术面+基本面研判 / 市场报价 / 10套策略库自动交易·监控。MT5 行情源,免 API Key。

Downloads

2,325

Readme

雪雪AI 本地交易系统(xuexue-ai-scan)

基于 MetaTrader 5(MT5) 行情源的本地交易辅助系统:行情扫描、技术面 + 基本面 + 新闻面研判、市场报价、多 Agent AI 助手,以及一套内置的黄金策略库用于自动交易与监控。 全部数据来自本地 MT5 终端,无需任何外部 API Key

  • 单端口运行(默认 8888),控制面板与自动交易面板合并为同一服务
  • 多 Agent 协同 AI 研判(导演路由 → 领域专家并行 → 综合研判 → 风控复核)
  • 可配置的 LLM 厂商接入(OpenAI / DeepSeek / 智谱 / 通义 / Kimi / Ollama / 自建等)
  • 10 套黄金优质策略(多周期 × 多类型,含回测与参数可视化)

一、核心特性

| 模块 | 说明 | | --- | --- | | 行情扫描(Scanner) | 对黄金(XAUUSD)与主要外汇(5 金 + 5 汇)做技术面 + 新闻面信号扫描,输出多空强度与建议。 | | 基本面分析 | 接入新闻快照的多空情绪分类(gold / forex / fed / trump),映射到品种级有符号分数,无需 LLM 即可给出基本面信号。 | | 市场报价 | 实时报价、点差、K 线与tick快照,源自本地 MT5。 | | AI 多 Agent 协同 | 导演(Director)意图路由 → 技术面 / 新闻面 / 策略 / 宏观 4 类领域专家并行研判 → 综合研判官 → 风控官下单前复核。 | | LLM 厂商配置 UI | 在面板内可视化增删改 LLM 厂商、连通测试、一键保存(保留其它配置段,自动备份)。 | | 策略库 & 自动交易 | 内置 10 套黄金优质策略(布林带突破 / EMA 交叉 / SuperTrend / 动量突破 / ADX 过滤 / RSI 均值回归等),止损止盈与点差挂钩。 | | 单端口合并 | 控制面板挂在 /,自动交易面板挂在 /auto,由单一 8888 端口对外服务,反向代理自动改写路径。 |


二、环境要求

  • Node.js ≥ 18(面板服务)
  • Python 3.10 ~ 3.13(扫描 / 自动交易 / AI 后端;已验证 MetaTrader5==5.0.5735pyzmq==27.1.0
  • MetaTrader 5 桌面终端(已登录账号,允许 DLL/Python 接入)
  • Windows 推荐;Linux/macOS 需自行配置 MT5(Wine 或远程行情网关)

三、快速开始

1. 安装依赖

# Node 面板依赖(通常无需额外安装,依赖已随包内置)
npm install

# Python 依赖
pip install -r requirements.txt

2. 配置

# 复制配置样例并按需修改
cp config.example.yaml config.yaml
cp .env.example .env
  • config.yaml:扫描品种、权重、AI 开关、LLM 端点、策略启用等。
  • .env:若需要,可放置密钥占位(建议留空或 ${ENV} 占位,避免明文)。

3. 启动(单端口 8888)

npm start
# 等价于:node scripts/serve_single.js

启动后:

控制面板与自动交易面板由同一进程托管,前者负责扫描 / 研判 / 报价,后者负责策略运行与订单监控。


四、目录结构

xuexue-ai-scan/
├── panel/              # 控制面板(前端 + server.py,8899 子进程)
│   ├── index.html      # 单页应用(行情/扫描/AI/基本面/策略)
│   └── server.py       # Flask 风格面板后端
├── panel_auto/         # 自动交易面板(8900 子进程,打包后由 serve_single 托管)
├── src/                # Python 核心库
│   ├── scanner.py          # 行情扫描主逻辑
│   ├── fundamental.py      # 基本面信号
│   ├── indicators.py       # 技术指标
│   ├── mt5_connector.py    # MT5 接入
│   ├── news_feed.py        # 新闻源(9 路)
│   ├── news_sentiment.py   # 新闻情绪
│   ├── macro_data.py       # 宏观数据
│   ├── ai_agents.py        # 多 Agent 协同框架
│   ├── ai_assistant.py     # AI 对话
│   ├── ai_llm.py           # LLM 封装 + 厂商预设
│   ├── ai_tools.py         # Agent 工具集
│   └── strategies_catalog.py # 策略库(含 705 套候选 + 10 套精选)
├── scripts/
│   ├── serve_single.js     # 单端口合并启动器(npm start 入口)
│   ├── serve.js            # 双子进程原始启动器
│   └── prune.js            # 打包前清理(prepack)
├── standalone_*.py     # 独立命令行入口(scan / connect / analysis / quotes)
├── strategy_auto.py    # 自动交易主循环
├── strategies_db.yaml  # 策略库定义
├── config.example.yaml # 配置样例
├── requirements.txt    # Python 依赖
└── docs/               # 文档与回测报告

五、AI 多 Agent 协同

在控制面板的「AI 研判」页,可选择三种模式:

  1. 单体 ReAct Agent —— 单一智能体逐步推理 + 工具调用。
  2. AI 对话 —— 直接问答,基于当前行情 / 持仓上下文。
  3. 🤝 多 Agent 协同(推荐)—— 导演路由意图,4 类领域专家并行研判,综合研判官汇总,风控官在下单前复核。

LLM 厂商配置:面板侧栏「🧩 LLM 厂商」可增删改厂商、设置激活厂商、连通测试并保存。预设覆盖 OpenAI / DeepSeek / 智谱 GLM / 通义千问 / Kimi / 豆包 / 百度 / 硅基流动 / Ollama / 内部端点等。

llm.internal 端点为空,AI 全功能(含多 Agent)需先填写真实可用端点;框架本身不依赖特定模型。


六、策略系统

内置 10 套黄金优质策略,覆盖多周期(M5 / M15 / M30 / H1)与多类型(突破 / 趋势 / 均值回归),均经过真实历史回测验证:

  • 止损止盈与点差挂钩sl_floor = max(sl_points, sl_spread_mult × 点差)tp_floor = max(tp_points, tp_spread_mult × sl_floor),回测与实盘同源,避免漂移。
  • 基本面信号:默认关闭 LLM 研判,改用新闻快照多空情绪分类(gold / forex / fed / trump)映射到品种级分数。
  • 策略库来源strategies_catalog.py 含 705 套候选,精选 10 套(及多样性优选 / 变异进化版本见 docs/)。

在「策略」页可查看每套策略的详细介绍、详细参数、回测报告(含净值曲线 SVG)与适用行情。


七、配置要点(config.yaml)

scanner:
  weights:
    fundamental: 0.4     # 基本面权重(主源:快照多空分类)
    news: 0.25           # 回退源:新闻情绪
  use_llm_fundamental: false   # 显式关闭 LLM 基本面研判

agents:                  # 多 Agent 协同开关
  enabled: true
  mode: multi
  risk_review: true
  specialists:
    technical: true
    news: true
    strategy: true
    macro: true

llm:
  internal:             # 留空则 AI 功能不可用,需填真实端点
    base_url: ""
    model: ""

具体字段以 config.example.yaml 为准;密钥建议用 ${ENV} 占位,勿明文写入。


八、命令行(独立入口)

npm run scan        # 等价于 python standalone_scan.py  —— 单次行情扫描
npm run connect     # python standalone_connect.py     —— 连接/检查 MT5
npm run analysis    # python standalone_analysis.py    —— 基本面/技术面分析
npm run quotes      # python standalone_quotes.py      —— 市场报价快照

九、打包与发布

本仓库以 npm 包形式分发,发布步骤(维护者专用):

# 1. 升版(修改 package.json 与 VERSION)
# 2. 预览打包内容
npm pack --dry-run

# 3. 用维护者 token 发布(token 通过 --userconfig 临时传入,不写入全局配置)
npm publish --access public --userconfig /path/to/xxcf_npmrc

files 字段已显式列出需发布的文件,config.yaml / .env 等含密钥文件经 files + .npmignore 双重排除,不会进入 tarball。


十、已知限制

  • MT5 依赖:行情与下单以本地 MT5 终端为数据源,终端未运行或账号未登录时功能受限。
  • AI 功能需端点:多 Agent / LLM 研判需配置真实可用的 LLM 端点;框架本身不内置模型。
  • 回测口径:回测基于历史 K 线与固定点差(如 260 点)估算,实盘滑点 / 隔夜费 / 流动性可能造成偏差。

十一、免责声明

本项目仅用于学习与技术研究,所有信号、策略与 AI 研判不构成任何投资建议。 交易涉及高风险,可能导致本金损失。使用者须自行承担一切交易后果,作者与维护者不承担任何盈亏责任。 请在合规前提下使用,并遵守所在地区法律法规与经纪商条款。


许可证

MIT © 雪雪财富(xuexue-ai)