AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Trading Audit Dashboard

skill-vishalmdi-trading-audit-dashboard-trading-audit-dashboard · by vishalmdi

>

— No reviews yet
0 installs
23 views
0.0% view→install

Install

$ agentstack add skill-vishalmdi-trading-audit-dashboard-trading-audit-dashboard

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • ✓ Prompt-injection patterns
  • ✓ Secret / credential exfiltration
  • ✓ Dangerous shell & filesystem operations
  • ✓ Untrusted network calls
  • ✓ Known-malicious package signatures

What it can access

  • ✓ Network access No
  • ✓ Filesystem access No
  • ✓ Shell / process execution No
  • ✓ Environment & secrets No
  • ✓ Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-vishalmdi-trading-audit-dashboard-trading-audit-dashboard)

Reliability & compatibility

✓ Security review passed
0 installs to date
— no reviews yet
○ 5mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Trading Audit Dashboard? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Trading Audit Dashboard Skill v2.0

Produces a full forensic trading performance audit as a single self-contained HTML dashboard. Covers 7 phases: Executive Dashboard, Strategy Reverse-Engineering, Behavioral Forensics, Advanced Analytics (NEW), Monte Carlo Forecasting, Professional Recommendations, and JSON Export.


Step 1 — Identify Input Format and Extract Trade Data

Read the uploaded file(s). Supported formats:

  • PDF (broker statements like Trading 212, eToro, IBKR) → use pdfplumber
  • CSV → parse with pandas/csv
  • XLSX → use openpyxl or pandas
  • JSON → load directly

For PDF Statements (most common)

import pdfplumber

with pdfplumber.open('file.pdf') as pdf:
    all_text = {}
    for i, page in enumerate(pdf.pages):
        all_text[i+1] = page.extract_text() or ''

Scan pages for CFD / derivatives trade tables. Look for pages containing:

  • Keywords: executed trades, CFD, closed, realized, settlement
  • Column headers: DIRECTION, BUY/SELL, QUANTITY, PRICE, RESULT, P&L, PROFIT

Skip Invest/equity account pages — only process CFD/derivatives/futures/forex closed trades.

Key Parsing Rules

For Trading 212 format:

  • Opening entries have - in the Average Price column → skip these
  • Closing entries have a populated Average Price → include these
  • TOTAL RESULT is the last EUR/USD amount on the line (after FX Fee, Result, Div Adj, OI)
  • Sign is literal in the text: €64.25 = profit, €-32.10 = loss

For generic CSV/XLSX:

  • Look for columns: profit, pnl, realized_pnl, net_result, closed_pnl
  • Parse open_time/close_time for hold duration
  • Extract volume/lots/quantity for position size analysis
  • Extract swap / commission / spread fields if present (used by cost drag analysis)

Minimum Required Fields Per Trade

trade = {
    'date': 'YYYY-MM-DD',
    'time': 'HH:MM:SS',          # or '00:00:00' if unavailable
    'datetime': 'YYYY-MM-DD HH:MM:SS',
    'direction': 'Buy' | 'Sell',
    'instrument': 'XAUUSD',      # ticker/symbol
    'size': 2,                   # lots/units/quantity
    'total_result': 64.25,       # signed float, positive=profit
    'order_type': 'Limit',       # optional
    'swap_cost': 0.0,            # optional — overnight financing (negative = cost)
    'spread_cost': 0.0,          # optional — spread/commission drag
}

Save to /home/claude/parsed_trades.json.


Step 2 — Compute All Statistics

Run scripts/compute_stats.py on the parsed trades. If the script is unavailable, compute inline using the formulas in references/statistics.md.

The script now computes all v2.0 metrics automatically:

Core Metrics (unchanged)

  • Win rate, avg win/loss, profit factor, expectancy, net P&L, max win/loss, trades/day

Session / DOW / Size / Order Type (unchanged)

  • Asian/London/NY session stats; Mon–Fri day-of-week; position size buckets; order type comparison

Sharpe Ratio & Max Drawdown (unchanged)

  • Annualised Sharpe; max drawdown in currency and percent

Monte Carlo (unchanged)

  • 10,000 simulations × remaining months of year; P10/P50/P90 projections

v2.0 NEW Metrics

Wilson Confidence Interval on Win Rate

# Formula in references/statistics.md → 'win_rate_ci' key
# Output: lower, upper, label, note
# Always display alongside win rate — critical for small samples ( 1 instrument detected)
```python
# 'instrument_matrix' key: instruments{}, best_by_sharpe, worst_by_sharpe

Transaction Cost / Swap Drag

# 'cost_drag' key: total_swap_cost, total_spread_cost, total_cost_drag,
#   cost_pct_of_gross, estimated (bool), note

Step 3 — Determine Starting Equity

Look in the broker statement for:

  • Trading 212: Account value in the CFD section of the Overview
  • IBKR: Net Asset Value or Starting Cash
  • eToro: Account Balance at period start
  • MetaTrader: Balance at start of statement period
  • If unavailable: estimate as abs(net_pnl) / 0.20 or ask user

Step 4 — Generate the HTML Dashboard

Read assets/dashboard_template.html for the full visual design system.

Substitute all {{PLACEHOLDER}} values with computed statistics.

Existing Placeholders (unchanged from v1.0)

| Placeholder | Value | |---|---| | {{TRADER_NAME}} | From statement header or "Trader" | | {{ACCOUNT_ID}} | From statement or "N/A" | | {{BROKER}} | Detected broker name | | {{INSTRUMENT}} | Primary instrument(s) traded | | {{PERIOD_START}} | Earliest trade date | | {{PERIOD_END}} | Latest trade date | | {{TRADING_DAYS}} | Count of distinct trading dates | | {{TOTAL_TRADES}} | len(trades) | | {{NET_PROFIT}} | netpnl formatted as currency | | {{WIN_RATE}} | e.g. "89.0%" | | {{PROFIT_FACTOR}} | e.g. "3.26" | | {{MAX_DRAWDOWN}} | e.g. "€177" | | {{EXPECTANCY}} | e.g. "€11.75" | | {{SHARPE}} | e.g. "16.12" | | {{AVG_WINNER}} | e.g. "€19.05" | | {{AVG_LOSER}} | e.g. "€47.33" | | {{EQUITY_LABELS}} | JS array of date strings | | {{EQUITY_DATA}} | JS array of running equity floats | | {{STARTING_EQUITY}} | Float | | {{SCENARIO_*}} | Bear/Base/Bull monthly projections | | {{SESSION_*}} | Asian/London/NY stats | | {{DOW_*}} | Mon–Fri stats | | {{SIZE_TABLE_ROWS}} | HTML table rows | | {{CURRENT_EQUITY}} | Starting + netpnl | | {{RETURN_PCT}} | Return % |

v2.0 New Placeholders

| Placeholder | Value | |---|---| | {{WIN_RATE_CI}} | e.g. "76–96% (95% CI)" | | {{WIN_RATE_CI_NOTE}} | Full CI note string | | {{KELLY_HALF}} | e.g. "12.3%" | | {{KELLY_FULL}} | e.g. "24.7%" | | {{KELLY_NOTE}} | Full Kelly recommendation text | | {{ROR_PCT}} | e.g. "0.23%" | | {{ROR_2X_PCT}} | e.g. "3.84%" (at double lot size) | | {{ROR_NOTE}} | Full RoR note | | {{DD_RECOVERY_TRADES}} | e.g. "15" | | {{DD_RECOVERY_DAYS}} | e.g. "3.0" | | {{MAX_LOSS_STREAK}} | e.g. "3" | | {{TILT_DETECTED}} | "Yes ⚠️" or "No ✅" | | {{TILT_DETAIL}} | Tilt detail string | | {{CURRENT_STREAK}} | e.g. "5 wins" or "2 losses" | | {{HOT_10_PNL}} | Best rolling 10-trade P&L | | {{COLD_10_PNL}} | Worst rolling 10-trade P&L | | {{ROLLING_TREND}} | "📈 Improving" / "📉 Declining" / "➡️ Stable" | | {{ROLLING_30D_WR}} | 30-day win rate % | | {{ROLLING_60D_WR}} | 60-day win rate % | | {{ROLLING_90D_WR}} | 90-day win rate % | | {{ROLLING_30D_PF}} | 30-day profit factor | | {{HOURLY_HEATMAP_DATA}} | JS array of {hour, avg_pnl, trades} for Chart.js | | {{BEST_HOUR}} | e.g. "09:00 UTC" | | {{WORST_HOUR}} | e.g. "14:00 UTC" | | {{INST_MATRIX_ROWS}} | HTML rows for instrument comparison table (or "N/A" if single) | | {{COST_DRAG_TOTAL}} | e.g. "€28.40" | | {{COST_DRAG_PCT}} | e.g. "4.2%" of gross | | {{COST_DRAG_NOTE}} | Full cost drag note | | {{OVERCONFIDENCE_DETECTED}} | "Yes ⚠️" or "No ✅" |

New Dashboard Sections to Add

After the existing Behavioral Forensics section, add these new panels:

Panel: Advanced Analytics — Kelly & Risk of Ruin

Panel: Rolling Performance Trend

Panel: Hourly P&L Heatmap (only if time data available)

Panel: Streak & Momentum

Panel: Multi-Instrument Matrix (only if > 1 instrument)

Panel: Transaction Cost Drag


Step 5 — Vulnerability Scorecard Logic (unchanged)

Rate each dimension with 🟢/🟡/🔴 using these rules:

| Dimension | 🟢 Green | 🟡 Yellow | 🔴 Red | |---|---|---|---| | Stop-Loss Discipline | Max loss 5× avg loss | | Position Sizing | All sizes positive | One size bucket negative | Multiple size buckets negative | | Over-Trading | Worst day WR > 85% | Worst day WR 80–85% | Worst day WR 3.0 | PF 1.5–3.0 | PF 88% rolling | WR 82–88% | WR 1 instrument

  • [ ] Cost drag panel shows "estimated" flag when applicable
  • [ ] Streak analytics panel shows current streak + hot/cold windows
  • [ ] Recommendations are specific and quantified, not generic
  • [ ] JSON stats file saved alongside HTML
  • [ ] Dashboard footer shows trade count, date range, and "v2.0" label

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.