Agent skill

Trading Analysis

by oopslink in oopslink/trading-skills

Analyze A-share money flow from tick-level data using the trading-analysis CLI, with both historical and real-time modes.

MITAuto-check passedBusiness, Finance & HR

Install Trading Analysis

skills CLI
$ npx skills add oopslink/trading-skills --skill trading-analysis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install oopslink/trading-skills trading-analysis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/oopslink/trading-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/trading-analysis .claude/skills/trading-analysis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
trading-analysis
GitHub stars
176
Token cost
~2k tokens
SKILL.md length
610 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

Analyze A-share money flow from tick-level data using the trading-analysis CLI, with both historical and real-time modes.

  • Works in 5 steps: Fetches 3-second tick snapshots from the… → Diffs adjacent snapshots to get… → Classifies direction: lastPrice >= ask1… → …
  • The user mentions money flow
  • SKILL.md covers Architecture, How It Works, Tier Thresholds (Default) and Commands, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Trading Analysis is an agent skill from oopslink/trading-skills. Analyze A-share money flow from tick-level data using the trading-analysis CLI, with both historical and real-time modes. Use this skill whenever the user mentions money flow, capital flow, main force inflow/outflow, institutional buying, tick-level analysis, order size classification (super-large/large/medium/small orders), real-time monitoring of capital flow, or wants to know whether smart money is buying or selling a stock. Also use when the user asks about 资金流向, 主力资金, 大单, 超大单, 散户, 逐笔分析, or 实时监控.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Business, Finance & HR, covering Trading and backtesting. The licence is MIT.

When your agent uses it

  • The user mentions money flow
  • Main force inflow/outflow
  • Institutional buying
  • Tick-level analysis

Example prompts

  • “/trading-analysis”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Fetches 3-second tick snapshots from the daemon (/data/ticks)
  2. Diffs adjacent snapshots to get per-interval delta (amount, volume, trade count)
  3. Classifies direction: lastPrice >= ask1 = active buy, <= bid1 = active sell, else neutral (split 50/50)
  4. Hybrid tier assignment: avg_amount = delta_amount / delta_trades determines tier, delta_amount is accumulated
  5. Aggregates buy/sell/net per tier, computes main force net (xlarge + large) and retail net (medium + small)

What it can do on your machine

Read from SKILL.md and the folder at commit 81fc72f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Trading Analysis loads about 2k tokens when it runs. Until then it costs about 131 tokens; SKILL.md has 610 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~131
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from oopslink/trading-skills at commit 81fc72f, republished under its MIT licence (© oopslink). 610 words, ~1,960 tokens.

Download SKILL.mdSave it as .claude/skills/trading-analysis/SKILL.md (or your agent's skills folder).
name
trading-analysis
description
Analyze A-share money flow from tick-level data using the trading-analysis CLI, with both historical and real-time modes. Use this skill whenever the user mentions money flow, capital flow, main force inflow/outflow, institutional buying, tick-level analysis, order size classification (super-large/large/medium/small orders), real-time monitoring of capital flow, or wants to know whether smart money is buying or selling a stock. Also use when the user asks about 资金流向, 主力资金, 大单, 超大单, 散户, 逐笔分析, or 实时监控.

trading-analysis: Tick-Level Money Flow Analysis

Architecture

trading-analysis CLI
        |
        v
  miniqmt_cli.client.transport (HTTP)
        |
        v
  miniqmt-cli daemon (Windows, port 8765)
        |
        v
  xtquant tick snapshots (3-second intervals)

Requires: miniqmt-cli daemon running + SSH tunnel active. Verify with miniqmt-cli health before use.

How It Works

  1. Fetches 3-second tick snapshots from the daemon (/data/ticks)
  2. Diffs adjacent snapshots to get per-interval delta (amount, volume, trade count)
  3. Classifies direction: lastPrice >= ask1 = active buy, <= bid1 = active sell, else neutral (split 50/50)
  4. Hybrid tier assignment: avg_amount = delta_amount / delta_trades determines tier, delta_amount is accumulated
  5. Aggregates buy/sell/net per tier, computes main force net (xlarge + large) and retail net (medium + small)

Tier Thresholds (Default)

TierAverage Per-Trade AmountLabel
Extra-large>= 100 wan (1,000,000)超大单
Large20 ~ 100 wan大单
Medium4 ~ 20 wan中单
Small< 4 wan小单

Thresholds are configurable via --thresholds.

Commands

bash
# Single stock, today, full trading day
trading-analysis moneyflow --code 002028.SZ

# Specify date (historical)
trading-analysis moneyflow --code 002028.SZ --date 20260416

# Custom time range
trading-analysis moneyflow --code 002028.SZ --start 093000 --end 110000

# Multiple stocks (outputs per-stock tables + ranking)
trading-analysis moneyflow --code 002028.SZ --code 000859.SZ --code 300618.SZ

# JSON output
trading-analysis moneyflow --code 002028.SZ --format json

# Custom thresholds (wan): small/medium boundary, medium/large, large/xlarge
trading-analysis moneyflow --code 002028.SZ --thresholds 4,20,100

# Use specific miniqmt-cli client config
trading-analysis moneyflow --code 002028.SZ --config ~/.miniqmt_cli/client.toml
Real-time Mode (--live)

Polls the daemon for latest tick snapshots every N seconds, accumulates deltas into a running summary, and displays via Rich Live (in-place terminal refresh). Ctrl+C to stop; prints final summary on exit.

bash
# Single stock real-time (default 10s refresh)
trading-analysis moneyflow --code 002028.SZ --live

# Multiple stocks real-time ranking
trading-analysis moneyflow --code 002028.SZ --code 000859.SZ --code 300618.SZ --live

# Custom refresh interval (30 seconds)
trading-analysis moneyflow --code 002028.SZ --live --interval 30
  • Single stock: full four-tier table, updated in-place
  • Multiple stocks: compact ranking table sorted by main force net inflow
  • Requires market hours for meaningful data; outside trading hours the display will show zeros
  • Combine with --signal to get alert-on-trigger behavior; see Signal Expressions below.

Signal Expressions (--signal)

Live mode supports a minimal expression language for triggering alerts when conditions are met. The expression is evaluated every refresh interval against the running per-stock state.

bash
# Alert when main force is net buying AND price is above MA20
trading-analysis moneyflow --code 002028.SZ --live \
  --signal "main_net > 0 and price > ma20"

# Alert on a reversal signal
trading-analysis moneyflow --code 002028.SZ --live \
  --signal "main_net > 500000 and ma5 > ma20"

# Multiple stocks — signal is evaluated per code independently
trading-analysis moneyflow --code 002028.SZ --code 000859.SZ --live \
  --signal "main_net > 0"

Variables (all in yuan unless noted):

VariableMeaning
main_netMain force net inflow (xlarge + large tiers)
retail_netRetail net inflow (medium + small tiers)
priceLatest tick lastPrice
ma5 / ma10 / ma20 / ma60Simple moving average of that many 1-minute closes

Operators: >, <, >=, <=, ==, and, or (lowercase only).

Literals: integers and floats; numbers are in yuan (e.g. 500000 = 50 wan).

Semantics:

  • If any referenced variable is None (e.g. MA window not yet filled), the signal is not triggered — no false positives during warm-up.
  • MA windows are auto-detected from the expression; ma20 triggers a preload of 20 1-minute klines before the live loop starts.
  • Trigger flips edge-sensitive: the alert fires once when False → True. It re-arms when the expression goes back to False.

Output: when triggered, the live display prints a red banner >>> 002028.SZ 信号触发: <expr> <<< and the footer shows "已触发: [codes]". On Ctrl+C exit, a final summary lists which codes ever triggered.

Limitations:

  • No parentheses — precedence is strictly cmp → and → or with left-to-right evaluation.
  • No arithmetic (+, -, *, /) inside expressions — compare variables to literal thresholds only.
  • No historical lookback beyond the MA window (no "price N minutes ago").
Show full SKILL.md (203 more words)Show less

Parameter Reference

ParameterDefaultFormat
--code(required, multiple)XXXXXX.SZ / XXXXXX.SH
--datetodayYYYYMMDD
--start093000HHMMSS
--end150000HHMMSS
--formattabletable / json / csv
--thresholds4,20,100comma-separated wan
--configfrom miniqmt-cli client.tomlpath
--liveoffflag
--interval10seconds

Output Example

002028.SZ  2026-04-16 09:30 ~ 15:00
──────────────────────────────────────────────────
档位       买入(万)    卖出(万)    净流入(万)   方向
超大单      1,230.5      480.2      +750.3    净流入
大单          860.1      920.3       -60.2    净流出
中单          340.7      290.1       +50.6    净流入
小单          180.3      210.8       -30.5    净流出
──────────────────────────────────────────────────
主力合计                             +690.1    净流入
散户合计                              +20.1    净流入

统计: 快照 4,800 条 | 有效区间 4,799 | 买入 2,103 | 卖出 2,288 | 中性 408

Multiple stocks append a ranking:

── 主力净流入排名 ──
#1  002028.SZ  +690.1万
#2  300618.SZ  +120.3万
#3  000859.SZ   -45.2万

Interpreting Results

  • 主力合计 > 0: Main force (institutions/large traders) net buying -- bullish signal
  • 主力合计 < 0: Main force net selling -- bearish signal
  • 超大单 dominant: Likely institutional activity
  • 大单 dominant without 超大单: Could be large retail or small institutional
  • All activity in 小单/中单: Retail-driven, no clear institutional signal

Troubleshooting

SymptomCauseFix
"cannot reach daemon"SSH tunnel or daemon downminiqmt-cli health; restart tunnel/daemon
"无数据"Non-trading hours, invalid code, or no cached dataCheck code format, try during market hours
All tiers show 0No trading activity in the time rangeWiden the time range
大单/超大单 always 03-second avg too small to hit thresholdLower thresholds: --thresholds 2,10,50
Live mode shows all zerosOutside trading hours, no new ticksRun during market hours (09:30-15:00)
Live mode not updatingDaemon not returning fresh snapshotsCheck miniqmt-cli health; ensure miniQMT client is open
  • miniqmt-cli — The daemon and data source underneath; the only supported way to reach the trading daemon

© oopslink, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/trading-analysis of oopslink/trading-skills.

Open the folder on GitHubat commit 81fc72f

Compare with similar skills

Trading Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Trading Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Trading Analysis this skilloopslink/trading-skills176—~2kAutomated safety check: PassMIT
Tushare Datazillionare/zillionare3192 repos~2.3kAutomated safety check: PassNone
Tradingview MCPatilaahmettaner/tradingview-mcp5k—~1.3kAutomated safety check: PassMIT
Digital Oraclekomako-workshop/digital-oracle870—~5.9kAutomated safety check: PassMIT
Fintoolsecond-state/fintool3161 repos~5.9kAutomated safety check: PassNone
Polyclawchainstacklabs/polyclaw3601 repos~2kAutomated safety check: PassApache-2.0

Similar skills

  • Tushare Data

    zillionare/zillionare

    面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。

    319 GitHub starsUsed in 2 repos~2.3k tokens
    Business, Finance & HRAuto-check passed
  • Tradingview MCP

    atilaahmettaner/tradingview-mcp

    AI Trading Intelligence — live prices, 30+ technical indicators, backtesting (6 strategies), walk-forward overfitting detection, trade logs, equity curves, licensed news sentiment (Marketaux), and…

    5k GitHub stars~1.3k tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Digital Oracle

    komako-workshop/digital-oracle

    Answer prediction questions using market trading data, not opinions.

    870 GitHub stars~5.9k tokensUpdated 2 mo ago
    Business, Finance & HRAuto-check passed
  • Fintool

    second-state/fintool

    Financial trading CLIs — spot and perp trading on Hyperliquid, Binance, Coinbase, OKX.

    316 GitHub starsUsed in 1 repo~5.9k tokens
    Business, Finance & HRAuto-check passed
  • Polyclaw

    chainstacklabs/polyclaw

    Trade on Polymarket via split + CLOB execution. An agent skill from chainstacklabs/polyclaw.

    360 GitHub starsUsed in 1 repo~2k tokens
    Business, Finance & HRAuto-check passed
  • Markdown

    facioquo/stock-indicators-dotnet

    Format and lint Markdown in this repository against GitHub Flavored Markdown and its markdownlint-cli2 configuration — headers, lists, code fences, callouts (VitePress containers on docs-site pages…

    1.2k GitHub stars~812 tokensUpdated today
    Business, Finance & HRAuto-check passed

More from oopslink/trading-skills

All 9 skills in this repo
  • Tushare Stock

    oopslink/trading-skills

    A skill your agent uses when querying A-share individual stock data including price history, real-time quotes, capital flow, shareholders, block trades, pledges, ETF, or sector health using…

    176 GitHub stars~609 tokensUpdated 4 mo ago
    Auto-check passed
  • Miniqmt CLI

    oopslink/trading-skills

    Operate miniQMT/xtquant via the miniqmt-cli tool -- market data queries, real-time streaming, account management, order placement with safety guards, daemon health checks, SSH tunnel management, and…

    176 GitHub stars~8.2k tokensUpdated 4 mo ago
    Auto-check passed
  • Tushare Alpha

    oopslink/trading-skills

    A skill your agent uses when performing sector rotation analysis, ranking Shenwan industry sectors by return or momentum, or building a sector strategy screen using tushare-cli.

    176 GitHub stars~281 tokensUpdated 4 mo ago
    Auto-check passed
  • Tushare Concepts

    oopslink/trading-skills

    A skill your agent uses when querying concept boards (概念板块), hot concept boards, board capital flow, board constituent stocks, or scanning for volume anomalies across boards using tushare-cli.

    176 GitHub stars~315 tokensUpdated 4 mo ago
    Auto-check passed
  • Tushare Futures

    oopslink/trading-skills

    A skill your agent uses when querying futures contracts, institutional futures holdings, futures intraday bars, NanHua commodity indices, or warehouse receipts using tushare-cli.

    176 GitHub stars~220 tokensUpdated 4 mo ago
    Auto-check passed
  • Tushare Index

    oopslink/trading-skills

    A skill your agent uses when querying Shenwan industry index (申万) daily data, sector constituents, or global market indices (S&P 500, Nikkei, HSI) using tushare-cli.

    176 GitHub stars~352 tokensUpdated 4 mo ago
    Auto-check passed

Questions about Trading Analysis

What does Trading Analysis do?

Analyze A-share money flow from tick-level data using the trading-analysis CLI, with both historical and real-time modes. Trading Analysis is an agent skill from oopslink/trading-skills. Analyze A-share money flow from tick-level data using the trading-analysis CLI, with both historical and real-time modes.

When should I use Trading Analysis?

Trading Analysis fits situations like: the user mentions money flow; main force inflow/outflow; institutional buying; tick-level analysis.

How do I install Trading Analysis in Claude Code?

Run `npx skills add oopslink/trading-skills --skill trading-analysis -a claude-code`. Or copy the skill folder (skills/trading-analysis in oopslink/trading-skills) into .claude/skills/trading-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Trading Analysis in Codex?

Run `npx skills add oopslink/trading-skills --skill trading-analysis -a codex`. Or copy the skill folder (skills/trading-analysis in oopslink/trading-skills) into .agents/skills/trading-analysis in your project. Codex loads it when a task matches its description.

Can I use Trading Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add oopslink/trading-skills --skill trading-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/trading-analysis, .gemini/skills/trading-analysis, .github/skills/trading-analysis and .opencode/skills/trading-analysis in your project.

What does Trading Analysis need to run?

SKILL.md names no scripts, command-line tools or credentials: Trading Analysis is instructions for the agent only.

Does Trading Analysis access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Trading Analysis safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Trading Analysis use?

Trading Analysis is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Trading Analysis use?

About 2k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Trading Analysis?

Skills that share tags, products or a category with Trading Analysis: Tushare Data (zillionare/zillionare, 319 stars), Tradingview MCP (atilaahmettaner/tradingview-mcp, 5k stars), Digital Oracle (komako-workshop/digital-oracle, 870 stars) and Fintool (second-state/fintool, 316 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Trading Analysis?

oopslink (a GitHub user) maintains it in oopslink/trading-skills, which has 176 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on May 24, 2026.

Source: oopslink/trading-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.