Before entering any position, I run three scenarios: bull case, base case, bear case. Multiply each by its probability. Sum the results. If the EV is negative, don't enter.
This sounds simple. In practice, when you're looking at a live chart with a position about to move, you skip it.
I built a Claude Code skill to make the calculation automatic and honest.
What the EV Calculator does
You give it a position description in plain language. It generates three scenarios with probability-weighted outcomes and returns a go/no-go with the expected value calculation shown.
Input:
NVDA current price $120
Bull case: AI infrastructure spend accelerates, price $145, probability 35%
Base case: Consolidation, price $118, probability 45%
Bear case: Macro deterioration, positions rotate out, price $95, probability 20%
Entry: $120, position size: 5% of portfolio
Output:
Expected Value Analysis — NVDA
Bull: $145 × 0.35 = $50.75
Base: $118 × 0.45 = $53.10
Bear: $95 × 0.20 = $19.00
EV: $122.85 vs entry $120.00
EV%: +2.4%
Risk-adjusted return: +$2.85/share
Max drawdown (bear case): -$25/share (-20.8%)
Kelly fraction (full): 11.5% → suggested size: 50% Kelly = 5.7% portfolio
Verdict: Positive EV. Risk/reward skewed bearish on downside magnitude.
Consider reducing position size if bear case materializes quickly.
Why probability-weighting matters more than price targets
Most retail investors have price targets but no probability weights. A $145 bull case sounds great until you realize you're assigning it 70% probability — implicitly, by not thinking about it — and the bear case is actually more likely.
Forcing yourself to assign explicit percentages that sum to 100% does two things:
- You have to make your assumptions explicit
- The math tells you if your thesis is actually bullish or just optimistic
The EV calculation makes it harder to enter a position with a positive price target but negative expected value.
Claude's role in the calculation
The skill uses Claude to:
- Parse natural language — you don't need to use a specific format
- Generate scenarios — if you only give one scenario, Claude asks clarifying questions
- Check probability calibration — if your probabilities don't sum to 100%, it flags it
- Provide commentary — the verdict includes a plain-language interpretation of the risk/reward
The math itself is trivial. The value is in the workflow: a structured format that forces you to think before you trade.
The Kelly Criterion integration
The skill also calculates a Kelly fraction — the theoretically optimal position size given your edge and win probability.
Kelly = (bp - q) / b
Where:
b = odds received (EV gain / potential loss)
p = probability of bull case
q = 1 - p (probability of loss)
Because full Kelly is aggressive, the skill defaults to half-Kelly (50% of the calculated fraction) with a note that this is conservative.
I use this as a sanity check, not a mandate. If Kelly says 15% and I'm thinking 5%, that's a mismatch worth examining.
Limitations I built in deliberately
The skill doesn't pull live prices — you enter them manually. This is intentional: it forces you to look at the chart, not automate the decision.
It also doesn't tell you what probabilities to use. That's the hard part of analysis, and it's yours to do. The skill takes your numbers and does the math honestly.
Installation (free)
The EV Calculator is in the free tier of the repo:
git clone https://github.com/tellmefrankie/ai-investment-skills?utm_source=devto&utm_medium=article
cp ev-calculator/SKILL.md ~/.claude/skills/ev-calculator.md
Then in Claude Code:
/ev-calculator
NVDA at $120. Bull $145 (35%), Base $118 (45%), Bear $95 (20%).
Works with Claude Code 1.0+, Cursor, Codex CLI — any agent supporting the SKILL.md standard.
The full options flow analyzer and morning briefing agent are in the Pro Bundle ($29).
Repo: github.com/tellmefrankie/ai-investment-skills — MIT licensed.
Not financial advice. Expected value calculations are only as good as the inputs.
Top comments (0)