Use case · Claude Code

A screener that ranks stocks by your rules, written for you.

Ready-made screeners rank by someone else's idea of strong. Ask Claude Code for yours: it reads each stock's chart through Kaairos, pulls the price history, writes a script that scores them the way you describe and saves the ranking as a CSV and a chart. The script stays in your folder, so next week it's one command.

Updated 20 November 2026

Bar chart made by Claude Code: eight stocks ranked by a trend plus momentum score, AAPL 91, AMZN 71, MSFT 65, AMD 55, AVGO 50, META 43, GOOGL 16, NVDA 16

The session

Claude Code · real session, 20 Nov 2026 · condensed
Use Kaairos to screen AAPL, MSFT, NVDA, AMD, AVGO, GOOGL, AMZN and META. Get each one's technical read over 6 months, then write screener.py (with .venv/bin/python) that ranks them on trend and momentum and saves screener.csv and a chart, screener.png. Tell me the top three and why.
kaairos_chart × 8, all at once AAPL · MSFT · NVDA · AMD · AVGO · GOOGL · AMZN · META · 6 months
each: price against its 20, 50 and 200-day averages, RSI, MACD, ATR, volume, support and resistance, 52-week range · as of the 19 Nov close
kaairos_prices × 8 daily, from 2025-10-01
8 files in market-data/ · 287 trading days each · adjusted for splits and dividends
write screener.py, then .venv/bin/python screener.py
rank symbol price score trend momentum ret_6m rsi14 1 AAPL 349.21 91.06 100 82.12 14.68 53.16 2 AMZN 257.37 70.88 80 61.75 -4.13 48.97 3 MSFT 498.30 64.88 60 69.75 19.35 39.54 4 AMD 489.19 55.38 40 70.75 8.81 45.16 5 AVGO 346.65 50.31 40 60.62 -16.10 52.56 6 META 596.22 43.12 20 66.25 -1.67 36.74 7 GOOGL 272.66 16.25 0 32.50 -29.58 30.58 8 NVDA 145.98 15.62 20 11.25 -33.35 19.64
AAPL passes all five trend checks, trading about 15% above its 200-day average and 3% below its 52-week high. AMZN has its trend intact but flat momentum, so it ranks second on trend rather than strength. MSFT has the best 6-month return in the group (+19%) but is now below its 50-day, so its short-term trend is weakening.
The whole session took 58 seconds. Left out: Claude Code checking the folder and the Python environment. Columns of the printed table are trimmed to fit.

What it made

Bar chart: eight stocks by a score out of 100, split into trend and momentum: AAPL 91, AMZN 71, MSFT 65, AMD 55, AVGO 50, META 43, GOOGL 16, NVDA 16
screener.png, as Claude Code drew it: each bar is the score, split into its trend half and its momentum half.

The scoring is Claude Code's own, from the words “trend and momentum”, and it said so: trend is five moving-average checks worth 20 points each (price above the 20, 50 and 200-day averages, the 20-day above the 50-day, the 50-day above the 200-day); momentum ranks the 6, 3 and 1-month returns against the other seven, weighted 40/30/30, with a small bonus for a positive MACD histogram. Tell it different rules and the script changes.

A useful cross-check came for free. The screener computes RSI itself from the price files, and its numbers match the reads Kaairos returned: AAPL 53.2, NVDA 19.6. Two independent calculations agreeing is a good sign the data is right.

Why do it this way

Your rules, written down

The ranking logic is a short Python file you can read, change and keep, not a black box on a website.

Eight reads at once

Claude Code asked Kaairos for all eight charts in parallel; each came back with the same set of indicators, computed the same way.

Real data underneath

Prices come from your own Alpaca connection, adjusted for splits and dividends, as of the last close.

See any chart for yourself

Ask Claude Code to show a stock in Kaairos and it opens in the Markets tab with its averages, RSI and MACD.

Ideas to try

  • “Screen the 11 sector ETFs every Monday and tell me which three lead on 3-month momentum.”
  • “Rank my watchlist by distance from the 52-week high, and flag anything with RSI under 30.”
  • “Add a volatility filter: drop anything whose ATR is more than 6% of its price.”
  • “Compare the top three of this screener with SPY over the last year.”

Set it up

  1. In Kaairos, connect Alpaca in Settings › Trading. A paper account is free and uses real market prices.
  2. In Settings › Claude Code, click Add Kaairos.
  3. Start a new Claude Code session in your project folder and ask in plain words. Type /mcp if you want to see Kaairos listed first.
Not advice

Kaairos and Claude Code report what the data shows. Neither gives investment advice, and a backtest describes the past, not the future. The paper account uses practice money.

Limits

  • A relative ranking only says who looks best among the names you gave it, not that any of them is strong.
  • Weights and rules are a choice. Change them and the middle of the table can reorder.
  • US stocks, ETFs and crypto pairs that Alpaca covers.

Fair questions

Can I keep the screener?

Yes. screener.py stays in your project; run it again and it reads fresh prices if you ask Claude Code to pull them first.

How many stocks can it screen?

As many as you name. Kaairos answers chart reads in parallel; the price files are small (a year of daily bars is about 14 KB).

Does it trade?

No. Screening only reads. A trade needs a separate request and your OK in Kaairos.

Download and go

Your AI agent, already set up.

One button to set up. Its own private AI, free. Claude, ChatGPT or Gemini when you want more.

A Mac with Apple silicon (M1 or later), macOS 15 Sequoia or later. 14-day refund.