Alpha Desk logo

Alpha Desk

Community
JingHao-Leon
alpha-desk

AI 投研工作台——在 deepseek-harness 里编排 virattt/ai-hedge-fund(美股多策略 AI 基金,支持回测)、iFinD 权威数据源(经 plugins/ifind 访问,财报/公告/股东/预测/选股,A股港股美股)与本地 A股/港股技术分析技能,配合 risk-gate 风控钩子、定时盯盘与投资记忆,完成"分析→回测→解读→复盘"的完整投研闭环。当用户要求分析美股、运行 AI 基金、回测策略、比较投资大师观点、生成投研报告、定时盯盘、复盘投资假设,或查询财报/财务报表/公告/股东户数/业绩预测/智能选股/iFinD/同花顺数据时使用。触发词:AI 基金、对冲基金、回测、巴菲特、格雷厄姆、投研、美股分析、盯盘、复盘、iFinD、同花顺、股东户数、财务报表、公告、业绩预测。

Overview

PublisherJingHao-Leon
Repositorydsh-alpha-desk
Skill namealpha-desk
Stars
169
Forks
0
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by JingHao-Leon on GitHub. Read the source before you install it.

Installation

Install the Alpha Desk AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/JingHao-Leon/dsh-alpha-desk/tree/main/skill
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/JingHao-Leon/dsh-alpha-desk.git /tmp/dsh-alpha-desk
mkdir -p .claude/skills
cp -r /tmp/dsh-alpha-desk/skill .claude/skills/alpha-desk
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Alpha Desk in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Alpha Desk on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Alpha Desk is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Alpha Desk — AI 投研工作台

把 dsh 会话变成一个投研交易台:底层引擎是 virattt/ai-hedge-fund(MIT,CLI 名 aihf),上层由 dsh 的 skill / hook / cron / memory 扩展点编排。

硬性合规线(每次回复都要遵守):

  • 本技能输出的是研究与教育内容,不是投资建议;每次给出结论时附上免责声明:"本内容仅供学习研究,不构成投资建议。"
  • 暂不执行真实交易。risk-gate 插件会拦截实盘命令,但即使插件未安装,也不得运行任何券商下单、资金划转命令。用户要求实盘时,明确拒绝并说明原因。
  • aihf 内部对 LLM 信号的调用本身会消耗用户的 LLM API 额度,运行前先告知。

前置条件检查(每次会话首次使用前执行)

bash
command -v aihf && aihf --help | head -5

未安装则:pipx install aihf(或 uv tool install aihf)。

运行需要两类 key(导出在 shell 环境,或写入 ~/.hedge-fund/.env):

  • FINANCIAL_DATASETS_API_KEY — 行情与基本面数据(financialdatasets.ai,有免费档)
  • 一个 LLM key:DEEPSEEK_API_KEY(推荐,与 dsh 同栈)或 ANTHROPIC_API_KEY / OPENAI_API_KEY / GOOGLE_API_KEY / XAI_API_KEY / KIMI_API_KEY

aihf 默认推理模型是 claude-sonnet-5(走 Anthropic)。用 DeepSeek 时,任选其一:

  • export HEDGE_FUND_LLM_MODEL=deepseek-v4-pro(全局默认)
  • 或在命令里加 --model deepseek-v4-pro(单次覆盖)

缺 key 时停下来让用户提供,不要伪造数据、不要编造回测结果。所有数字必须来自 aihf 的真实输出。

核心概念:mandate(基金委托书)

mandate 是一个 YAML,描述"交易台"本身——策略、投资大师模型、风控、资金、再平衡频率——不含股票代码;标的是运行时通过 --tickers 传入的。本仓库 mandates/ 目录自带三份:

文件风格再平衡适用场景
deep-value-weekly.yaml格雷厄姆×2 + 巴菲特 + 芒格,70% 价值 + 30% 财报漂移量化weekly默认首选,稳健演示
fundamental-ls-market-neutral.yaml五位大师投票的多空市场中性monthly展示多空推理
inflections-daily.yaml德鲁肯米勒 + 林奇的宏观拐点daily压力测试风控

可用的 alpha 模型(models[].name):graham、buffett、munger、lynch、druckenmiller(LLM 驱动);pead(财报漂移,量化,不消耗 LLM 额度)。用户想自定义组合时,复制一份 mandate 改写即可。

工作流一:单次投研周期("今天这只基金怎么看这几只票")

bash
aihf mandates/deep-value-weekly.yaml --tickers AAPL,MSFT,NVDA --out records/cycle-$(date +%F).json
  • stdout 是纯 JSON(CycleRecord),人类摘要走 stderr;始终用 --out 落盘到 records/ 供复盘。
  • CycleRecord 关键字段:strategies[].signals[](每个模型的 value ∈ [-1,1] 看多/看空强度 + reasoning 文字理由)、positions(成交后持股)、equity_before、skipped(数据缺失的票及原因)。
  • 解读时:先念各模型的 reasoning 原文要点,再给综合仓位变化——"巴菲特为什么看多、格雷厄姆为什么反对"是用户最想看的。分歧要明确指出,不要和稀泥。

工作流二:回测("这套策略过去一年表现如何")

bash
aihf mandates/deep-value-weekly.yaml --tickers AAPL,MSFT,NVDA --backtest --start 2025-08-01 --out records/backtest-$(date +%F).json
  • 回测从 --start 到 --date(默认今天)按 mandate 的再平衡频率逐周期运行,输出含净值曲线与基准(mandate 里的 benchmark)对比指标。
  • 解读必给:累计收益 vs 基准、最大回撤、胜率,以及哪几次调仓贡献/拖累最大(从逐周期记录里定位)。
  • 回测耗 LLM 额度 = 周期数 × 模型数 × 标的数,运行前估算并告知用户(例:weekly × 52 周 × 3 个 LLM 模型 × 3 只票 ≈ 468 次调用)。想省钱就先缩短区间或减少模型。
  • 明确提醒:历史回测不代表未来收益。

工作流三:A股/港股联动

aihf 只覆盖美股。用户问 A股/港股时,改用 stock-technical-indicators 技能(如已安装)。两边结果可以同框对比(例:"同一套价值逻辑在美股和 A股各自选出什么"),但要讲清两边引擎和数据源不同,结论不可直接互换。

工作流三·五:iFinD 权威数据(plugins/ifind,免 iFinD 账号)

需要权威基本面/公告/股东/预测数据时(财务报表、业务分部、股东户数、业绩预告、智能选股),用本仓库 plugins/ifind/ifind_tool.py——它经 Kimi agent-gw 访问同花顺 iFinD,凭证由脚本自行解析(plugins/ifind/.env 或本机 Kimi 桌面端配置),不需要用户提供任何账号,也不依赖环境变量注入。

bash
# 1. 先读 API 目录(9 个 API 的参数、ticker 格式、覆盖范围约定)
terminal/.venv/bin/python plugins/ifind/ifind_tool.py describe

# 2. 按目录的参数约定调用(必须用 terminal/.venv/bin/python,它有 agent-gw SDK)
terminal/.venv/bin/python plugins/ifind/ifind_tool.py call ifind_get_financial_statements \
  --params-json '{"ticker": "600519.SH", ...}'

规则:

  • 必须先 describe 再 call,参数严格按返回的目录构造(ticker 格式:A股 600519.SH、港股 0001.HK、美股 AAPL.O)。
  • 公告与业绩预测仅覆盖 A 股;调用失败时如实报告错误,禁止编造财务数字。
  • 引用数据时带上报告期/币种/数据口径限定语。
  • 与 gtimg 行情的分工:盘中报价/K线走行情网关,基本面与公告走 ifind。

工作流四:定时盯盘(cron)

用户要求"每天盘前/盘后自动跑"时,用 dsh 的定时任务能力注册调度,例如:

  • 美东盘前(北京时间 21:30 前):跑工作流一,输出当日信号摘要
  • 每周五收盘后:跑回测增量更新 + 本周假设复盘

定时任务产出的记录同样落盘 records/。

工作流五·五:公开预测台账(ledger/,对外可验证)

每次给出可结算的方向性观点(某标的在某时间窗内看多/看空/横盘)时,除了写进记忆,还要入台账:

bash
python3 tools/ledger.py new --symbol <代码> --market cn|hk|us --direction long|short|neutral \
  --confidence <0~1> --horizon <YYYY-MM-DD> --rationale "<理由,必填>" \
  --source "workflow:<来源>" [--invalidate-if "<失效条件>"]

规则:

  • rationale 必填且要具体(依据什么数据/逻辑)——没有理由的观点不入台账。
  • confidence 是自评置信度,事后会做校准统计(声明 0.7 的预测是否 70% 命中),不要拍脑袋给 0.9。
  • new 会自动 git commit;尽快 push(公开时间戳才成立)。commit 后不可改写已入库的预测。
  • 到期后(或用户要求复盘时):python3 tools/ledger.py settle,然后 python3 tools/ledger.py report --write 更新 stats.md,并把结果 commit + push。
  • 结算是机械的(收盘价 + 死区 + 方向),禁止人工改判定结果;数据缺失会记 void 不计分。
  • 台账战绩从零累积、拒绝回填:如实展示 miss 与低胜率,这比虚假战绩值钱。

工作流六:投资记忆与复盘

  • 每次给出一个观点时,把"假设"写进记忆:标的、方向、理由、预期时间窗、失效条件。
  • 复盘时取出历史假设,对照 records/ 里的实际信号与走势,逐条判定对错,并总结哪类假设胜率高。
  • 这是本工作台区别于一次性问答的核心:观点要被记录、被检验、被追责。

失败处理

  • skipped 非空 → 告知用户哪些票数据缺失(常见于新股、退市、数据源未覆盖),不要静默忽略。
  • 报 ANTHROPIC_API_KEY not found 之类错误 → 说明用户没配 LLM key 或没指定模型;提示配 DEEPSEEK_API_KEY 并加 --model deepseek-v4-pro,不要擅自换成别的 provider。
  • 网络/额度错误 → 原样报告 stderr,不要重试超过两次。
  • 用户给的 mandate 路径不存在 → 先用 ls mandates/ 列出可用的,让用户选。

安全红线(risk-gate 插件已装时由其强制执行,未装时自律)

  • 禁止:任何券商 API/CLI 下单命令(ibkr、alpaca、tda、富途、老虎等)、向券商域名发写请求、--live 类参数。
  • 禁止:修改 ~/.hedge-fund/.env 之外的任何凭证文件。
  • 允许:aihf 的全部只读/回测用法、数据查询、报告生成。

Frequently asked questions

What does the Alpha Desk AI skill do?

AI 投研工作台——在 deepseek-harness 里编排 virattt/ai-hedge-fund(美股多策略 AI 基金,支持回测)、iFinD 权威数据源(经 plugins/ifind 访问,财报/公告/股东/预测/选股,A股港股美股)与本地 A股/港股技术分析技能,配合 risk-gate 风控钩子、定时盯盘与投资记忆,完成"分析→回测→解读→复盘"的完整投研闭环。当用户要求分析美股、运行 AI 基金、回测策略、比较投资大师观点、生成投研报告、定时盯盘、复盘投资假设,或查询财报/财务报表/公告/股东户数/业绩预测/智能选股/iFinD/同花顺数据时使用。触发词:AI 基金、对冲基金、回测、巴菲特、格雷厄姆、投研、美股分析、盯盘、复盘、iFinD、同花顺、股东户数、财务报表、公告、业绩预测。

Why use Alpha Desk on TypingMind?

Because you install it once and use it with any model. Alpha Desk is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Alpha Desk in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/JingHao-Leon/dsh-alpha-desk/tree/main/skill. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Alpha Desk?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Alpha Desk?

As many as you like. As long as a model supports skills, you can use Alpha Desk with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Alpha Desk AI skill free?

Yes. It is published on GitHub by JingHao-Leon under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇