trading-analysis
Analyze A-share money flow from tick-level data using the trading-analysis CLI, with both historical and real-time modes.
Skill by oopslink
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/oopslink-trading-analysis
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: data, finance
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/trading-analysis
What's inside
- Skill 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 实时监控.
- License
- MIT
- Instructions
- 193 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# 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)
| Tier | Average Per-Trade Amount | Label |
|------|-------------------------|-------|
| Extra-large | >= 100 wan (1,000,000) | 超大单 |
| Large | 20 ~ 100 wan | 大单 |
| Medium | 4 ~ 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):
| Variable | Meaning |
|----------|---------|
| `main_net` | Main force net inflow (xlarge + large tiers) |
| `retail_net` | Retail net inflow (medium + small tiers) |
| `price` | Latest tick `lastPrice` |
| `ma5` / `ma10` / `ma20` / `ma60` | Simple 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.From oopslink/trading-skills, MIT.
More from oopslink/trading-skills
- 0.668score
miniqmt-cli
oopslink
Operate miniQMT/xtquant via the miniqmt-cli tool -- market data queries, real-time streaming, account management, order placement with safety guards, daemon…
SkillCFreshness: C★ 176Claude Code +9 - 0.608score
tushare-query
oopslink
Use when setting up tushare-cli token, choosing output formats, or getting an overview of available A-share market data query skills
SkillDFreshness: D★ 176Claude Code +9 - 0.283score
tushare-futures
oopslink
No description from the publisher yet.
SkillDFreshness: D★ 176Claude Code +9 - 0.283score
tushare-index
oopslink
No description from the publisher yet.
SkillDFreshness: D★ 176Claude Code +9 - 0.283score
tushare-stock
oopslink
No description from the publisher yet.
SkillDFreshness: D★ 176Claude Code +9 - 0.283score
tushare-alpha
oopslink
No description from the publisher yet.
SkillDFreshness: D★ 176Claude Code +9 - 0.283score
tushare-concepts
oopslink
No description from the publisher yet.
SkillDFreshness: D★ 176Claude Code +9 - 0.280score
tushare-forex
oopslink
No description from the publisher yet.
SkillDFreshness: D★ 176Claude Code +9 - 0.280score
tushare-financial
oopslink
No description from the publisher yet.
SkillDFreshness: D★ 176Claude Code +9
Compare and alternatives
Featured in
Signals
- Stars
- 176
- Forks
- 23
- Open issues
- 0
- Last commit (this folder)
- May 13, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/oopslink/trading-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from oopslink
- 0.668score
miniqmt-cli
oopslink
Operate miniQMT/xtquant via the miniqmt-cli tool -- market data queries, real-time streaming, account management, order placement with safety guards, daemon…
SkillCFreshness: C★ 176Claude Code +9 - 0.608score
tushare-query
oopslink
Use when setting up tushare-cli token, choosing output formats, or getting an overview of available A-share market data query skills
SkillDFreshness: D★ 176Claude Code +9
Cite this page
trading-analysis skill. Agent Mart. https://agentmart.dev/skills/oopslink-trading-analysis (last updated 2026-10-24)