Guide 2026-05-05 · By Julie Derthing, Chief Staff Assistant at Seentio

How to Create the Greenblatt Magic Formula Strategy

The Magic Formula is one of the most-replicated value investing strategies in the academic literature. Joel Greenblatt published it in 2005 and it's been the subject of dozens of papers since. The premise is simple: buy good companies (high return on capital) at cheap prices (high earnings yield), hold around 30 of them, and rebalance once a year (or monthly, in our setup).

This guide walks you through creating the strategy on Seentio using Claude Code in plain English. No code, no math, no spreadsheets.

What you'll learn

How to ask Claude Code to build, preview, save, and activate the Greenblatt Magic Formula strategy on your Seentio account in under 5 minutes.

Prerequisites

Before you start, make sure you have:

If you haven't connected MCP yet, follow our 5-minute setup guide first.

Step-by-step walkthrough

1. Open Claude Code and ask plainly

Type into your Claude Code prompt:

Build me Greenblatt Magic Formula. Show me the top 30 picks first.

That's it. You don't need to know the factors. You don't need to know the universe filters. Claude handles the lookup.

2. Watch what Claude does

Claude will call three Seentio tools in sequence:

  1. lookup_strategy("Greenblatt") — fuzzy-matches your request against built-in templates. The result comes back with confident_match: greenblatt_magic_formula (score 0.95). This is the safety check that prevents Claude from guessing the strategy spec from its training knowledge.

  2. get_template("greenblatt_magic_formula") — fetches the full ranking specification: two factors (earnings yield via 1/EV_EBITDA, return on capital via ROA), combined by rank-sum, top 30, equal-weighted, monthly rebalance, US equities ≥ $100M market cap, excluding Financial Services and Utilities (per Greenblatt's textbook spec).

  3. dry_run_ranking(ranking) — previews which 30 tickers would be selected against today's snapshot. No commitment yet — nothing has been saved.

You'll see a table of 30 stocks with their earnings yield, ROIC, sector, and market cap.

3. Tweak the universe if you want

If you don't like what you see, ask Claude to adjust:

Bump the minimum market cap to $500 million, and exclude Basic Materials too.

Claude re-runs dry_run_ranking with the new universe filter. The list updates. Iterate until you're happy with the picks.

4. Save the strategy

When the picks look right:

Save this as 'Greenblatt Magic Formula' with monthly rebalance.

Claude calls create_strategy(name="Greenblatt Magic Formula", ranking={...}, rebalance="monthly"). The response includes a summary field that Claude will read back to you. It looks like:

Saved 'Greenblatt Magic Formula' as draft. Holds top 30 stocks ranked by earnings_yield (1 / ev_ebitda) + roic (roa) via rank_sum, equal-weighted, monthly rebalance. Universe: US equities ≥ $500M, excluding Financial Services, Utilities, Basic Materials.

Read this summary carefully. If anything's off, ask Claude to update or delete-and-recreate. The summary is the safety check that confirms what was actually saved matches your intent.

The strategy is now in your account as a draft — saved but not running.

5. Optionally backtest before activating

You can preview historical performance before going live:

Backtest this strategy from 2023 to today against SPY.

Claude calls backtest_strategy which now correctly honors the ranking block (a v3.5.21 fix — earlier versions silently fell back to a misleading market-cap default). You'll get an annualized return, Sharpe ratio, max drawdown, and a rebalance log. Note that walk-forward backtests use today's snapshot for the entire historical period, so they don't reflect survivorship bias perfectly — read our backtest guide for the caveats.

6. Activate against your brokerage

When you're ready to go live:

Activate it on my E*Trade account, email alerts only.

Claude will call list_brokerage_accounts to find the right account ID, then activate_strategy(strategy_id, snaptrade_account_id, alert_channels=["email"]). Status flips from draft to active. You'll get a confirmation message telling you when the next rebalance fires.

Important: nothing trades automatically. Activation just means the strategy is wired into our scheduled rebalance system — you'll get a proposal email when it's time, and you have to click through to execute.

Tips & common questions

What's next

Need more help? Visit our Chat page to ask Seentio's AI assistant, or reach out at contact@app-seentio.com.

Frequently Asked Questions

What is the Greenblatt Magic Formula?

It's Joel Greenblatt's value-quality strategy from 'The Little Book That Beats the Market.' You rank stocks by two factors — earnings yield (cheap) and return on capital (efficient) — and hold the top 30. Seentio's implementation uses 1/EV_EBITDA for earnings yield and ROA as the return-on-capital proxy because those are the cleanest substitutes available in our daily snapshot data.

How long does it take to set this up?

Under 5 minutes once you have a Seentio API token and Claude Code installed. The whole flow is: ask Claude to look up the strategy, preview the picks, save it, then activate against your brokerage. No SQL, no spreadsheets, no Python.

Will my Magic Formula picks include foreign companies?

By default yes — many foreign companies trade as US-listed ADRs and pass our filters (companies like Equinor, Novo Nordisk, TSMC). Greenblatt himself argued the formula works because it casts a wide net. If you want pure US-domiciled, you can ask Claude to add common ADR tickers to your `exclude_tickers` list, but be aware that's a moving target.

What does 'monthly rebalance' mean for this strategy?

Once a month, Seentio re-runs the formula against the latest snapshot data and generates a rebalance proposal — which stocks to add, which to drop, how much to buy and sell to stay on target. You receive an email (or SMS/Slack on higher tiers) with a review link. Nothing executes automatically — you click through and approve before any trades hit your brokerage.

What if the AI gets the strategy wrong?

Two safety nets catch this. First, Claude calls `lookup_strategy` to match your request against vetted templates with aliases — it doesn't guess from training knowledge. Second, after saving, the response includes a plain-English `summary` of exactly what was saved (factors, top_n, cadence, universe). Read that summary and confirm it matches your intent before activating. If something's wrong, ask Claude to update the strategy or delete it and start over.

Related Research

Track these stocks in real time

See the data behind the research. Start with Seentio's free tier.

Get started free