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_…