Skip to content

vishalmdi/trading-audit-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trading Audit Dashboard

Python License Claude Skill Version

Forensic trading performance audit — from any broker statement to an institutional-grade HTML dashboard in seconds.

Supports Trading 212, Interactive Brokers, eToro, MetaTrader 4/5, Binance Futures, NSE/NFO (Indian markets), and any generic CSV export.


Trading Audit Dashboard Screenshot


What It Does

Upload any broker trading statement (PDF, CSV, XLSX, or JSON) and get a self-contained dark-theme HTML dashboard with:

  • Executive summary — Net P&L, win rate, profit factor, drawdown, Sharpe ratio
  • Equity curve with monthly P&L breakdown
  • Strategy reverse-engineering — trade archetype, edge analysis, fat-tail risk
  • Behavioral forensics — session analysis, revenge trading detection, tilt patterns
  • Advanced analytics — Kelly sizing, risk of ruin, rolling windows, hourly P&L heatmap
  • Monte Carlo projections — 10,000 simulations, bull/base/bear scenarios
  • Quantified recommendations — up to 5 actionable rule changes with expected impact

Features

7-Phase Analysis

Phase Description
1. Executive Dashboard Vital stats: net P&L, win rate, profit factor, max drawdown, expectancy, Sharpe
2. Strategy Reverse-Engineering Archetype classification, edge identification, fat-tail risk
3. Behavioral Forensic Audit Session/DOW analysis, revenge factor, holding patterns
4. Advanced Analytics (v2.0) Kelly sizing, risk of ruin, rolling performance, hourly heatmap, streak analytics
5. Statistical Forecasting Monte Carlo simulation (10,000 runs), 3-scenario projections
6. Professional Recommendations Up to 5 quantified, actionable improvements
7. JSON Export Complete stats object (70+ fields) for downstream use

v2.0 New Metrics

  • Wilson Confidence Interval on win rate (95% CI)
  • Kelly Criterion — Full Kelly + Half Kelly position sizing
  • Risk of Ruin — at current sizing and 2× leverage
  • Drawdown Recovery — estimated trades and days to recover
  • Loss Streaks & Tilt Detection — consecutive loss patterns
  • Rolling Period Comparison — 30/60/90-day performance windows
  • Hourly P&L Heatmap — UTC 0–23 heat map of best/worst trading hours
  • Multi-Instrument Matrix — per-symbol Sharpe, win rate, and P&L
  • Transaction Cost / Swap Drag — quantified cost as % of gross profit
  • Streak & Momentum Analytics — hot/cold windows, post-win overconfidence

Supported Brokers

Broker Format Notes
Trading 212 PDF CFD statement, auto-detects closing entries
Interactive Brokers (IBKR) CSV Flex Query Full position and P&L columns
eToro CSV / XLSX Realised P&L export
MetaTrader 4 / 5 CSV / HTML Detailed statement or history export
Binance Futures CSV Closed position history
NSE / NFO (India) CSV F&O, futures, and options trades
Generic CSV CSV Column-name heuristics for any broker

Quick Start — Run with Demo Data

Prerequisites

pip install pdfplumber openpyxl pandas

Step 1: Clone the repository

git clone https://github.com/vishalmdi/trading-audit-dashboard.git
cd trading-audit-dashboard

Step 2: Parse the demo trades

The demo dataset (demo/intraday_trading_log.csv) contains 4,155 real-style Indian F&O trades across NSE futures and options (Jan 2023 – Dec 2024).

python scripts/parse_trades.py demo/intraday_trading_log.csv
# Output: parsed_trades.json

Step 3: Compute statistics

python scripts/compute_stats.py parsed_trades.json
# Output: trading_stats.json  (70+ metrics)

Step 4: View the pre-built demo dashboard

Open the included demo output directly in your browser:

# macOS
open demo/trading_audit_dashboard.html

# Linux
xdg-open demo/trading_audit_dashboard.html

# Windows
start demo/trading_audit_dashboard.html

The dashboard shows the full analysis of the demo dataset — equity curve, Monte Carlo projections, behavioral forensics, Kelly sizing, and all 7 phases.


Using as a Claude Skill

This project ships as a Claude skill (.skill file) that can be installed directly into Claude.

Install

  1. Download trading-audit-dashboard.skill
  2. Open Claude → Settings → Skills → Import Skill
  3. Import the .skill file

Trigger Phrases

Once installed, Claude activates this skill automatically when you say:

  • "Analyze my trades"
  • "Audit my trading history"
  • "Create a trading dashboard"
  • "Review my performance"
  • "P&L analysis"
  • "Trading report"
  • Or simply upload a broker statement file

Claude will parse the file, compute all statistics, and produce a self-contained HTML dashboard.


File Structure

trading-audit-dashboard/
├── README.md                          This file
├── LICENSE                            MIT
├── SKILL.md                           Claude skill definition (v2.0)
├── trading-audit-dashboard.skill     Packaged skill archive (ZIP)
│
├── assets/
│   └── dashboard_template.html       Dark-theme HTML/CSS/JS dashboard template
│                                      (Chart.js, 44+ template placeholders)
│
├── references/
│   ├── broker_formats.md             Broker parsing rules and column mappings
│   └── statistics.md                 Statistical formulas and vulnerability thresholds
│
├── scripts/
│   ├── parse_trades.py               Universal broker statement parser
│   │                                  Supports PDF/CSV/XLSX, auto-detects broker
│   └── compute_stats.py              Statistics engine — 70+ metrics, v2.0 analytics
│
└── demo/
    ├── intraday_trading_log.csv      Sample dataset: 4,155 Indian F&O trades
    ├── trading_audit_dashboard.html  Pre-built demo dashboard output
    └── screenshot.png                Dashboard preview

Tech Stack

Component Technology
PDF parsing pdfplumber
XLSX parsing openpyxl, pandas
Statistics Pure Python (numpy-free for portability)
Dashboard UI HTML5 + CSS3 + JavaScript
Charts Chart.js 4.4
Fonts Space Mono, Bebas Neue, DM Serif Display (Google Fonts)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you'd like to change.

Areas for contribution:

  • New broker parsers (add to scripts/parse_trades.py)
  • Additional statistical metrics (add to scripts/compute_stats.py + references/statistics.md)
  • Dashboard UI improvements (edit assets/dashboard_template.html)

License

MIT © 2026 vishalmdi

About

Forensic trading audit dashboard for any broker — Kelly sizing, Monte Carlo, behavioral analytics. Claude skill.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors