# Trade Journal

Analyze a user's trade journal (CSV/Excel broker export).

- Repository: https://github.com/HKUDS/Vibe-Trading (37375 stars)
- Category: Documents
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add HKUDS/Vibe-Trading --skill trade-journal -g -a claude-code -y`
Codex: `npx skills add HKUDS/Vibe-Trading --skill trade-journal -g -a codex -y`
Cursor: `npx skills add HKUDS/Vibe-Trading --skill trade-journal -g -a cursor -y`
Gemini CLI: `npx skills add HKUDS/Vibe-Trading --skill trade-journal -g -a gemini-cli -y`

## Description

Analyze a user's trade journal (CSV/Excel broker export). Parses 同花顺/东方财富/富途/generic formats, produces a trading profile and 4 behavior diagnostics (disposition effect, overtrading, chasing, anchoring). Use the `analyze_trade_journal` tool.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Trade Journal Analysis

## Purpose

Users upload broker exports (交割单) and get an honest, data-grounded portrait
of their own trading. Two layers are live:

- **Profile**, holding days, frequency, win rate, PnL ratio, cumulative PnL,
  max drawdown, top symbols, market/hourly distribution.
- **Behavior diagnostics**, 4 biases, each with severity (low/medium/high)
  and numeric evidence: disposition effect, overtrading, chasing momentum,
  anchoring.

Strategy extraction → backtest bridge lands in Phase 4c.

Supported formats (auto-detected):
- **同花顺** (Tonghuashun), A-share CSV, typically GBK-encoded
- **东方财富** (Eastmoney), A-share CSV, typically GBK-encoded
- **富途** (Futu), HK/US CSV, UTF-8
- **Generic**, any CSV with columns like `datetime/symbol/side/qty/price`

## Usage

**Call the `analyze_trade_journal` tool directly. Never run Python from bash.**

```
analyze_trade_journal(file_path="uploads/xxx.csv")
analyze_trade_journal(file_path="uploads/xxx.csv", analysis_type="profile")
analyze_trade_journal(file_path="uploads/xxx.csv", filter_expr="2026-01 to 2026-03")
analyze_trade_journal(file_path="uploads/xxx.csv", filter_expr="symbol=600519.SH")
analyze_trade_journal(file_path="uploads/xxx.csv", filter_expr="market=china_a")
```

`analysis_type`:
- `full` (default), profile + behavior (strategy still placeholder)
- `profile`, profile metrics only (fastest)
- `behavior`, 4 behavior diagnostics only
- `strategy`, Phase 4c placeholder

`filter_expr` (optional):
- Date range: `"YYYY-MM to YYYY-MM"` or `"YYYY-MM-DD to YYYY-MM-DD"`
- Symbol: `"symbol=600519.SH"` (exact match on qualified symbol)
- Market: `"market=china_a|us|hk|crypto"`

## Return shape (profile subset)

The rest: https://github.com/HKUDS/Vibe-Trading/blob/HEAD/agent/src/skills/trade-journal/SKILL.md
