leionion
ai-trading-journal-audit-tool
Python

Drop in your Binance or Bybit CSV export. An AI agent identifies revenge trading, overleverage, FOMO entries, and other psychological errors โ€” with dollar attribution per error class. Runs locally. No API keys. No account linking.

Last updated Jul 2, 2026
20
Stars
1
Forks
0
Issues
0
Stars/day
Attention Score
49
Language breakdown
No language data available.
โ–ธ Files click to expand
README

AI Trading Journal Audit Tool

Analyze Binance and Bybit trading journal CSV files to detect behavioral trading mistakes

Local-first trading journal analyzer for identifying revenge trading, overleverage, FOMO entries, session weakness, and other costly trading patterns from your CSV history.


Audit demo โ€” live console output

What This Project Does

AI Trading Journal Audit Tool is a trading journal analyzer for Binance and Bybit CSV exports.

Most trading journals show basic metrics like win rate, profit and loss, or average risk-reward. This tool goes further by identifying behavioral trading mistakes and showing which patterns are damaging performance.

It reads your trade history, reconstructs trade sequences, detects repeated error patterns, and generates an audit report with:

  • flagged trades
  • behavioral error labels
  • severity scores
  • session-based performance analysis
  • estimated dollar cost by error type
This project is built for:
  • crypto traders reviewing their own performance
  • discretionary traders trying to reduce emotional mistakes
  • trading coaches and educators
  • developers building trading psychology or journaling products
Everything runs locally. No exchange account linking, no cloud upload, and no requirement to send trading data to external services.

Below is the text report format. The example shows a larger run; the bundled sample CSVs produce shorter reports.

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
  AI TRADING JOURNAL AUDIT โ€” REPORT v0.4.1
  Account Snapshot: BYBITUSDTPERP | Period: 2026-02-14 โ†’ 2026-02-28
  Trades Analyzed: 47 | Flagged: 19 (40.4%) | Generated: 2026-02-28 14:32 UTC
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

PSYCHOLOGICAL ERROR BREAKDOWN โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ REVENGE_TRADING โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘ 8 instances | -$412.50 attributed OVERLEVERAGE โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 6 instances | -$318.00 attributed FOMO_ENTRY โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 4 instances | -$174.20 attributed LOSSAVERAGINGDOWN โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 1 instance | -$89.00 attributed โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ TOTAL BEHAVIORAL COST 19 flagged trades | -$993.70 attributed

FLAGGED TRADE DETAIL (Top 5 by severity) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ [CRITICAL] Trade #31 | 2026-02-21 03:17 UTC Pair: SOLUSDT | Side: LONG | Size: 18x leverage | PnL: -$214.00 Error: REVENGE_TRADING Reason: Entry placed 4 minutes after Trade #30 closed at -$108.00. Position size increased 3.2x vs prior trade. Classic loss-recovery escalation pattern detected. โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ [HIGH] Trade #38 | 2026-02-24 11:44 UTC Pair: ETHUSDT | Side: SHORT | Size: 25x leverage | PnL: -$189.00 Error: OVERLEVERAGE Reason: 25x on a position sized 18% of account equity. Leverage exceeded your 14-day personal median (8x) by 212%. No stop-loss detected in export metadata. โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ [HIGH] Trade #12 | 2026-02-17 20:58 UTC Pair: BTCUSDT | Side: LONG | Size: 10x leverage | PnL: -$97.20 Error: FOMO_ENTRY Reason: Entry at local 4H high following a 6.2% candle. Price had already moved; entry places you at maximum extension. No retracement or consolidation confirmation detected. โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

PATTERN SUMMARY โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Primary driver of losses: Revenge trading loop after drawdown Trigger condition: Back-to-back losses within 2-hour window Risk escalation: You increase position size after losses, not after wins โ€” inverse of healthy sizing Safest session: UTC 08:00โ€“12:00 (London open) โ€” 71% win rate Most destructive session: UTC 00:00โ€“04:00 โ€” 23% win rate, highest avg leverage

RECOMMENDATION โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Rule to implement: Hard stop after 2 consecutive losses in any 4-hour window. Mandatory 90-minute cooldown before re-entry. Projected impact: Eliminates 8 of 19 flagged trades ($412.50).

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•


๐Ÿ”ฌ Psychological Error Taxonomy

The agent classifies trades against a structured taxonomy built specifically for crypto derivatives trading. These are not generic labels โ€” each has a precise, measurable detection signature.

| Error Class | Detection Signature | Common Trigger | |---|---|---| | REVENGE_TRADING | Entry < 10 min after loss + position size increase โ‰ฅ 1.5x | Consecutive losses in same session | | OVERLEVERAGE | Leverage > 2x personal 14-day median AND > 15% equity per trade | High-volatility breakout moves | | FOMO_ENTRY | Entry at or above N-period high after โ‰ฅ 4% candle with no pullback | Viral price moves, Twitter/CT pumps | | LOSSAVERAGINGDOWN | Same-direction add-on after open position goes negative โ‰ฅ 5% | Strong trend against position | | PREMATURE_EXIT | Exit before TP with โ‰ฅ 60% of target achieved, trade would have hit TP | Recent losing streak causing fear | | OVERTRADING | > 3x personal daily trade average with no increase in win rate | Slow market / boredom / drawdown | | POSITIONSIZECHAOS | Standard deviation of position sizes > 80% of mean over 7-day window | Emotional state volatility |


โš”๏ธ How This Compares to Every Alternative You've Tried

| | AI Trading Journal Audit Tool | TraderSync | Tradervue | Notion Template | Manual Spreadsheet | Generic ChatGPT | |---|---|---|---|---|---|---| | Reads Binance/Bybit CSV directly | โœ… | โœ… (paid) | โœ… (limited) | โŒ manual | โŒ manual | โŒ no structure | | AI behavioral error detection | โœ… | โŒ stats only | โŒ stats only | โŒ | โŒ | โš ๏ธ inconsistent | | Detects revenge trading specifically | โœ… | โŒ | โŒ | โŒ | โŒ | โš ๏ธ if prompted right | | Session-timing analysis | โœ… | โš ๏ธ basic | โš ๏ธ basic | โŒ | โŒ | โŒ | | Dollar cost per error type | โœ… | โŒ | โŒ | โŒ | โŒ | โŒ | | No account linking required | โœ… | โŒ OAuth | โŒ OAuth | โœ… | โœ… | โœ… | | Data stays local (no cloud) | โœ… | โŒ SaaS | โŒ SaaS | โœ… | โœ… | โŒ OpenAI | | Structured psychological taxonomy | โœ… 4 classes (7 in roadmap) | โŒ | โŒ | โŒ | โŒ | โŒ | | Monthly cost | $0 | $29.95/mo | $29.95/mo | $0 | $0 | ~$20/mo |


๐Ÿ—๏ธ System Architecture

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                  AI TRADING JOURNAL AUDIT TOOL                   โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฆโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฆโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘  INPUT LAYER โ•‘   AGENT CORE          โ•‘   OUTPUT LAYER             โ•‘
โ•‘              โ•‘                       โ•‘                            โ•‘
โ•‘  Binance CSV โ• โ•โ•โ–บ CSV Parser         โ•‘   audit_report.txt         โ•‘
โ•‘  Bybit CSV   โ•‘    (normalize schema) โ•‘   flagged_trades.json      โ•‘
โ•‘              โ•‘         โ”‚             โ•‘   error_summary.csv        โ•‘
โ•‘              โ•‘         โ–ผ             โ•‘                            โ•‘
โ•‘              โ•‘   Trade Sequencer     โ•‘   [Full Build Only]        โ•‘
โ•‘              โ•‘   (chronological +    โ•‘   Streamlit Dashboard      โ•‘
โ•‘              โ•‘    context windows)   โ•‘   PDF Audit Report         โ•‘
โ•‘              โ•‘         โ”‚             โ•‘   GPT-4o Coach Prompts     โ•‘
โ•‘              โ•‘         โ–ผ             โ•‘   Multi-session Heatmap    โ•‘
โ•‘              โ•‘   Behavioral          โ•‘                            โ•‘
โ•‘              โ•‘   Classifier Agent    โ•‘                            โ•‘
โ•‘              โ•‘   (rule-based; LLM    โ•‘                            โ•‘
โ•‘              โ•‘    in full build)      โ•‘                            โ•‘
โ•‘              โ•‘         โ”‚             โ•‘                            โ•‘
โ•‘              โ•‘         โ–ผ             โ•‘                            โ•‘
โ•‘              โ•‘   Pattern Aggregator  โ•‘                            โ•‘
โ•‘              โ•‘   (cross-trade        โ•‘                            โ•‘
โ•‘              โ•‘    error scoring)     โ•‘                            โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฉโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฉโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
  No API keys.   Runs locally.   Your CSV never touches a server.

โš™๏ธ Installation & Setup

Step 1 โ€” Clone the repository

git clone https://github.com/leionion/ai-trading-journal-audit-tool.git cd ai-trading-journal-audit-tool

Step 2 โ€” Create a virtual environment and install dependencies

python -m venv venv source venv/bin/activate        # Windows: venv\Scripts\activate pip install -r requirements.txt

Step 3 โ€” (Optional) Configure LLM in .env for future enrichment

cp .env.example .env 

The beta uses rule-based classification โ€” no API key required.

.env is for future LLM-backed features (v0.5.1+).

Step 4 โ€” Export your trade history CSV

  • Binance: Account โ†’ Order History โ†’ Export โ†’ Select date range โ†’ Download CSV
  • Bybit: My Assets โ†’ Order History โ†’ Export โ†’ Trade Records โ†’ Download
Step 5 โ€” Run the audit (paper mode โ€” read only, no live connection)
python audit.py --csv your_trades.csv --exchange binance --mode paper 

Or omit --exchange to auto-detect from CSV headers

Your audit report will be written to ./output/auditreportYYYYMMDDHHMMSSmicroseconds.txt (unique per run).

Try with sample data:

python audit.py --csv sampletradesbybit.csv --exchange bybit --mode paper python audit.py --csv sampletradesbinance.csv --exchange binance --mode paper


๐Ÿ”ง Configuration Reference

# config.yaml โ€” full configuration reference

โ”€โ”€ LLM Settings โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

llm: provider: openai # openai | anthropic | ollama | groq model: gpt-4o-mini # gpt-4o-mini is sufficient; gpt-4o for higher accuracy temperature: 0.1 # keep low โ€” you want deterministic classifications max_tokens: 2000

โ”€โ”€ Behavioral Classifier Settings โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

classifier: revengetradingwindow_minutes: 10 # time window to check for lossโ†’entry pattern overleveragemedianmultiplier: 2.0 # triggers if leverage > 2x personal 14d median fomocandlethreshold_pct: 4.0 # entry after X% candle with no pullback mintradesfor_pattern: 3 # minimum trades before pattern-level flagging

โ”€โ”€ Exchange Schema โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

exchange: name: binance # binance | bybit instrument_type: futures # futures | spot currency: USDT

โ”€โ”€ Output Settings โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

output: format: text # text | json | both includerawflags: true # include per-trade detection reasoning dollar_attribution: true # calculate PnL attributed to each error class session_analysis: true # break down performance by UTC session

๐Ÿ—บ๏ธ Roadmap

โœ… Shipped

  • v0.1.0 โ€” Binance CSV parser + trade sequencer
  • v0.2.0 โ€” Core behavioral classifier (4 error classes)
  • v0.3.0 โ€” Bybit CSV support + schema normalization
  • v0.4.0 โ€” Pattern aggregator + dollar attribution per error class
  • v0.4.1 โ€” Session timing analysis (UTC session breakdown)

๐Ÿ”จ Active Development

  • v0.5.0 โ€” Full 7-class error taxonomy (3 new classes)
  • v0.5.1 โ€” Groq and Ollama LLM backend support (fully local, zero API cost)
  • v0.5.2 โ€” JSON + CSV output formats alongside text report

๐Ÿ”œ Planned (Private Build)

  • v0.6.0 โ€” Streamlit dashboard with interactive trade timeline
  • v0.7.0 โ€” Multi-session heatmap (performance by day/hour grid)
  • v0.8.0 โ€” GPT-4o coaching prompt generator (personalized to your error profile)
  • v0.9.0 โ€” OKX and Hyperliquid CSV support
  • v1.0.0 โ€” PDF audit report export + shareable summary card

๐Ÿ”’ Want the Full Audit Engine?

The public build gives you the core classifier. Serious traders who want the complete system โ€” dashboard, coaching prompts, heatmaps, and full 7-class taxonomy โ€” reach out directly.

This is built for:

| Profile | What You Get | |---|---| | Retail trader losing > $500/month to behavioral errors | The full report shows exactly which errors to eliminate first โ€” highest ROI fix identified by dollar impact | | Trader who's profitable but inconsistent | Pattern analysis reveals which sessions and market conditions destabilize your edge, and which to double down on | | Developer building a prop firm or trading education platform | The classifier engine and taxonomy are available for integration โ€” structured output, clean API | | Quant / algo trader reviewing discretionary override decisions | Behavioral audit of manual interventions against your systematic signals โ€” quantify how much your gut costs you |

How to reach me:

โ†’ GitHub: github.com/leionion โ†’ Open a GitHub Discussion or drop a note on any issue

When you reach out, mention:

  • Which exchange you trade on and roughly how many trades per month
  • Whether you want the full personal audit build or the developer/integration version
  • The single biggest pattern you already suspect in your own trading
The gap between this public build and the private one isn't a matter of time โ€” it's a feature gap that's intentional. The full version surfaces the things most traders don't want to see. That's exactly why it works.

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท leionion/ai-trading-journal-audit-tool ยท Updated daily from GitHub