I Built an AI to Roast My Portfolio - Here is What It Found

Published on February 15, 2026

AI robot grading a trader with an F report card

For the past three years, I’ve been investing on Trading 212. Mostly automated weekly buys into ETFs and a handful of individual stocks. I never really looked at the numbers. I assumed the DCA strategy was working, that the automation was protecting me from my own worst instincts, and that time in the market would sort things out.

So I exported my entire transaction history and asked Claude Code to build a skill that would tell me the truth. Not just “did you make money,” but “did you panic sell,” “did you chase FOMO,” “how much did your timing cost you,” and “would you have been better off buying SPY and forgetting your password?”

The answer to that last question, by the way, is yes. Very much yes.

The Experiment

The idea was simple: take my raw CSV exports from Trading 212, fetch the historical market data for every ticker I’d ever touched, and run each action through a gauntlet of timing analysis and behavioral pattern detection.

I wanted to know:

  • How good (or bad) was my timing on each trade?
  • Did I panic sell during dips that later recovered?
  • Did I chase stocks after they’d already run up?
  • How did my portfolio compare to just holding SPY?
  • Were my automated DCA buys actually helping?

I didn’t write the code myself. I described what I wanted, and Claude Code built the entire pipeline - four Python scripts, a portfolio tracker, seven behavioral pattern detectors, risk-adjusted return metrics, and an HTML report that opens with a personalized roast of my trading decisions.

The Pipeline

The system works in four stages:

CSV Exports (Trading 212)
  → parse_csv.py    → Normalised actions
  → fetch_market.py → Historical prices & dividends
  → analyze.py      → Timing scores, patterns, risk metrics
  → report.py       → Self-contained HTML report

Stage 1: Parse the broker CSVs into standardised actions - buys, sells, dividends, deposits - with the currency and exchange rate metadata needed for multi-currency math later.

Stage 2: Fetch historical prices and dividends from Yahoo Finance for every ticker, using yfinance to handle authentication and rate limiting.

Stage 3: Analyze. This is where it gets interesting. The analyzer makes two passes through the data:

First, a chronological pass builds portfolio state - tracking average cost basis per ticker, realized P&L on each sell, deposits, withdrawals, dividends, interest, and current holdings valued at latest market prices.

Second, each BUY and SELL gets a timing score from -100 (catastrophic) to +100 (perfect), based on what the price did in the 90 days after the action. A buy followed by a 50% rally? Great timing. A sell followed by a 50% rally? Terrible timing. Every action also gets a dollar impact estimate - how much better you’d have done with optimal timing in a 90-day window.

Stage 4: Report. A self-contained HTML file with a floating table of contents, color-coded score bars, detailed breakdown cards for every pattern detected, and a roast section that pulls no punches.

The Roast

The report opens with a section titled “The Roast.” Here’s what it said about my portfolio:

The Roast

Your timing score suggests you have a remarkable talent for buying high and selling low. Most people do this accidentally - you seem to have made it a strategy.

You chased momentum over a hundred times. You basically showed up to the party after everyone left and wondered why the music stopped.

Your portfolio underperformed SPY significantly. You spent all that time researching stocks, stressing about earnings, and panic-selling during dips… and you would have done better buying one ETF and forgetting your password.

Your Sharpe ratio is essentially zero. For context, anything below 1.0 means you’re not being adequately compensated for the risk you’re taking. You’re essentially volunteering for stress.

OK, credit where it’s due: thousands of your buys were part of disciplined DCA sequences. Automated investing is the one thing you’re doing right. The machines are better at this than you - and you were smart enough to let them.

Every line is generated from my actual data. The system checks the severity of each metric and picks an appropriate roast - harsher for worse numbers, backhanded compliments for anything positive.

What It Detected

Before I get into the findings, it’s worth explaining what each of these patterns actually means. These aren’t obscure financial metrics - they’re common behavioral traps that most retail investors fall into without realizing it.

FOMO Buying (Fear of Missing Out)

You see a stock up 15% this week. Twitter is buzzing. Your coworker mentions it. You think “I need to get in before it goes higher.” So you buy - right after the big move has already happened.

That’s FOMO buying. The system detects it by looking for purchases made after a stock has already rallied more than 10% in the previous 10 trading days. The problem is that big run-ups are often followed by pullbacks. You end up buying near a short-term top.

For each FOMO buy, the report shows exactly what happened next: the drawdown from your entry, the price trajectory at 1 week, 1 month, and 3 months, and what the optimal entry would have been if you’d waited.

The system flagged this as my most common and most damaging pattern.

Panic Selling

The mirror image of FOMO. A stock drops sharply - maybe 5-10% in a few days. The red numbers feel like they’ll never stop. You sell to “cut your losses” or “preserve capital.”

Then the stock recovers.

The system flags sells that happen after a sharp decline (more than 5% in 5 trading days) and then tracks what happened next. Did the stock bounce back? How long did it take? What would you have made if you’d held? For each panic sell, it shows the recovery trajectory and calculates exactly how much the emotional exit cost you.

Missed Dividends

This one’s subtle. You sell a stock, and a few days later it goes ex-dividend - meaning anyone holding it on that date gets paid. You sold just before the payout.

The system checks every sell against the ex-dividend calendar and flags any that happened within two weeks of a dividend payment. It calculates the exact amount you missed, converted to your account currency.

It’s not always a mistake - sometimes you have good reasons to sell. But doing it repeatedly suggests you’re not checking the calendar.

Wash Sales

You sell a stock at a loss. A week later, you buy it back. Congratulations - you’ve locked in a loss for tax purposes while maintaining the exact same position. In many jurisdictions, this negates the tax benefit of the loss entirely.

The system detects any sell followed by a repurchase of the same stock within 30 days. It’s not inherently bad if you’re doing it intentionally, but doing it hundreds of times suggests it’s accidental - and it’s essentially paying transaction costs to achieve nothing.

The Sharpe Ratio

This measures how much return you earned per unit of risk. A Sharpe ratio above 1.0 means your excess returns (above a risk-free savings account) justified the volatility you endured. Below 1.0 means you took on more risk than you were compensated for. At zero or near-zero, you could have earned the same return with zero risk by just holding cash.

My Sharpe ratio was essentially zero. All the stress, all the checking, all the volatility - and I earned no more than a savings account would have, adjusted for risk.

DCA (Dollar-Cost Averaging)

The one bright spot. DCA means investing a fixed amount at regular intervals - say, £20 into VUSA every Wednesday - regardless of what the market is doing. You buy more shares when prices are low, fewer when they’re high, and your average cost tends to smooth out over time.

The system detects these sequences by looking for recurring buys of the same ticker with similar amounts at regular intervals (weekly, biweekly, monthly). It requires at least four buys to qualify and scores each sequence on consistency.

The DCA Revelation

The most interesting finding was about my automated investing. The system detected hundreds of distinct DCA sequences covering thousands of individual buys. These are my weekly automated purchases - same tickers, similar amounts, regular intervals.

Here’s the thing: the DCA buys were the best part of my portfolio.

The system compares each DCA sequence against two alternatives: the period average price, and a lump sum invested on the first buy date. For many of my sequences, DCA achieved a lower average cost than the period average - exactly what the strategy is supposed to do.

More importantly, the DCA detection fixed a reporting problem. Before I added it, my automated weekly buys kept getting flagged as “FOMO buys” or “worst-timed buys.” If NVDA happened to rally 10% in the 10 days before my scheduled Wednesday buy, the system would flag it as chasing momentum. That’s not fair - it’s a scheduled, automated purchase. The system now detects these patterns and excludes DCA actions from emotional trading flags while still tracking their timing quality.

Technical Challenges

Multi-currency math. My portfolio has trades in six currencies. You can’t just subtract prices across currencies. The solution is a percentage-based approach: compute the price change as a percentage in trade currency, then apply it to the GBP total. And Trading 212’s exchange rate is a divisor - getting this wrong inverts every calculation.

Stock splits and ticker mismatches. This one nearly invalidated the entire analysis. Some stocks in my portfolio had undergone stock splits - both forward splits and reverse splits - between the time I traded them and now. Yahoo Finance retroactively adjusts all historical prices for splits, so a stock I bought at $424 might show up as $42 in the data because of a 10-for-1 split that happened later.

The first clue was a penny stock showing impossibly high timing scores. The CSV said I bought at $0.16, but Yahoo Finance had the price at $24 on the same day. That’s not a rounding error - it’s a 1-for-100 reverse split that happened months after I sold.

To find all of these, I had Claude Code write a mismatch detector that compared every trade price in my CSV against Yahoo Finance’s close price on the same date. Anything with more than a 30% discrepancy got flagged. It found a dozen tickers affected by splits - including some well-known names that had done forward splits I’d completely forgotten about.

The fix was to pull each stock’s split history from Yahoo Finance and adjust the share quantities and prices in the CSV to match Yahoo’s split-adjusted basis. A pre-split buy of 0.1 shares at $424 becomes 1 share at $42.40 - same total cost, just different units. Without this step, the portfolio tracker was wildly overvaluing some positions and the timing scores were meaningless for anything that had split.

What I’m Changing

Looking at the report, a few things are clear:

Stop chasing momentum. If a stock has already run up significantly, I shouldn’t be buying it manually. Set a limit order below the current price and let it come to me.

Trust the DCA. The automated buys are doing their job. The machines don’t panic, don’t chase, and don’t check their phones during market hours. My best strategy is to keep funding the automated investments and stop trying to time individual purchases.

Check the ex-dividend calendar. I sold before ex-dividend dates dozens of times. That’s free money left on the table. A 30-second calendar check before any sell order would fix this.

Consider simplifying. The benchmark comparison is damning. SPY massively outperformed my portfolio over the same period. The near-zero Sharpe ratio means all the complexity of managing hundreds of tickers added essentially zero risk-adjusted value. There’s a strong argument for consolidating into a handful of broad ETFs and letting the DCA run.

Building With Claude Code

One thing worth noting: I didn’t write this skill. I described what I wanted - “analyze my trades against market data, detect behavioral patterns, compare against SPY, generate an HTML report” - and Claude Code built it across multiple sessions.

The first session parsed the CSVs and fetched market data. The second built the timing analysis and pattern detection. The third added portfolio tracking with realized/unrealized P&L. Later sessions added the roast section, well-timed/worst-timed pattern detection with detailed reasoning, DCA detection, benchmark comparison, and risk-adjusted return metrics.

The entire codebase is open source at am-i-bad-trader. It lives as a Claude Code skill - a reusable template that can analyze any brokerage CSV export, not just Trading 212. The skill includes reference documentation for CSV formats, Yahoo Finance API behavior, and the full analysis methodology.

What surprised me most was how iterative the process was. Each analysis run revealed something that needed fixing - the exchange rate bug, the field access pattern, the FOMO detection flagging DCA buys, the stock split adjustments silently corrupting timing scores. Claude Code would diagnose the issue, fix it, and re-run. The stock split problem is a good example: I noticed one ticker’s numbers looked wrong, Claude Code wrote a mismatch detector that scanned all two hundred tickers against Yahoo Finance, found a dozen affected by splits, then built the adjustment logic to fix them all. The pipeline went from broken to producing a comprehensive report across a handful of conversations.

The Uncomfortable Truth

Here’s what three years of data tell me: I would have been better off automating everything and never opening the app.

Every manual trade - every “I should buy this” and “I need to sell that” - performed worse on average than my automated weekly buys. The panic sells during dips cost me. The FOMO buys after run-ups cost me. The constant trading in the same tickers cost me in spread and opportunity cost.

The DCA sequences? They quietly did their job. No drama, no stress, no checking the portfolio at 2 AM.

The report ends with this line, and I think it’s the right note to close on:

Despite all of this chaos, you somehow made a positive return overall. Imagine what you’d have made if you just bought an index fund and touched grass instead.

Fair point.

Roast Yourself

If you want to find out how bad your trading decisions were, the tool is open source: am-i-bad-trader. Export your CSV from Trading 212 (or any supported brokerage), run four commands, and get your own personalized roast. You can also install it as a Claude Code skill and just say “analyze my portfolio” - Claude handles the rest.

Fair warning: you might not like what it finds.