I built a system that watches the stock market, analyzes every ticker on my watchlist every 15 minutes, and decides whether to buy, sell, or hold. Then it executes the trade.

No dashboard refreshing. No gut feelings. No "I should've sold yesterday."

It runs on a $5/month server. The AI costs about $175/month in API fees. And it's been trading on a paper account while I watch from Slack notifications on my phone.

Here's what I learned.

How it actually works

The system pulls three types of data for every stock: technical indicators (price action, volume, moving averages), market sentiment (news, fear & greed index), and fundamental data (earnings, analyst ratings, sector trends).

All of that gets fed into Claude — not ChatGPT, not Gemini — with a prompt that says: “You're a quantitative analyst. Score this stock 0-100 and tell me what to do.”

If the score hits 80+, it buys. Below 30, it sells. Everything in between, it holds.

The parts that were hard

Building the trading logic was the easy part. Getting the AI to score stocks consistently? That took a while.

The first version would swing wildly — 90 on Monday, 40 on Tuesday, for the same stock with barely any price movement. The scores weren't anchored to anything repeatable.

The fix was breaking the analysis into multiple passes. One pass for technicals, one for sentiment, one for fundamentals, then a final pass that synthesizes everything into a single score. Each specialist pass has its own prompt and its own criteria. The synthesis pass weighs them and makes the call.

The safety nets

This is where it gets interesting. Because if you're going to let a machine trade money, you need circuit breakers.

The system has a daily loss limit — if the portfolio drops more than 3% in a day, it stops trading until tomorrow. There's a max drawdown limit — if total equity drops 15% from its peak, everything pauses. Three losing trades in a row? Automatic cooldown.

I also added bracket orders — every buy automatically places a stop-loss and a take-profit. If a stock drops 2%, it sells. If it gains 5%, it sells. The AI picks the entry, but the exits are mechanical.

The cost question

Running this isn't free. The server is $5/month. The AI API calls run about $175/month at current settings. That's $2,160/year before it makes a single dollar.

So the math only works if the system can consistently beat what I'd do manually — which, if I'm honest, is mostly checking my phone during lunch and making emotional decisions based on whatever headline I just read.

The AI doesn't read headlines during lunch. It doesn't panic. It doesn't hold losers because it "believes in the company." It just runs the numbers every 15 minutes and does what the data says.

Whether that's enough to justify the cost is something I'll know in a few months. I'll keep you posted.

Prompt of the Week

"The Portfolio Gut Check"

Whether you use AI for trading or not, this prompt is useful for any investor:

Here is my current stock portfolio: [list your holdings with approximate allocation percentages].

My investment goals: [growth / income / preservation / mix]
My risk tolerance: [aggressive / moderate / conservative]
My time horizon: [X years]

Analyze my portfolio and tell me:
1. Am I actually diversified, or do I just think I am?
2. Which positions are redundant (tracking the same sector/theme)?
3. What's my biggest concentration risk?
4. If the market dropped 20% tomorrow, which of these would I regret holding?

Be direct. Don't soften bad news.

Until next week,
Scott

P.S. — If you've ever tried using AI for investing decisions — even just asking ChatGPT "should I buy X" — reply and tell me how it went. I'm curious if anyone else has gone down this rabbit hole.

Keep reading