Back to projectsMuhamad Syafiq
Live · running 24/7

Autonomous AI Trading Bot

A 24/7 trading-signal system that scans US equities, reasons with Claude AI, gates every call through deterministic risk rules, paper-trades the outcomes, and re-learns its own edge every day. Operated entirely from Telegram.

The problem

Discretionary trading doesn't scale and doesn't remember. You can't watch a few hundred symbols at once, you talk yourself into marginal setups, and the reasons behind a good or bad trade evaporate a week later. Every decision is a one-off with no paper trail and nothing that compounds.

I wanted a system that behaves like a disciplined process instead of a mood: screen the whole universe every cycle, apply the same rules every time, write down why it did what it did, and get measurably better from its own tracked results, without me sitting in front of a screen.

The pipeline, step by step

Every cycle runs the same six steps. Raw prices go in one end; a gated, logged, paper-traded decision comes out the other. The outcome loops back into the scoring that drives the next cycle.

1
Scan
Watchlist screen on US equities
2
Features
EMA / RSI / ATR / volume / VWAP
3
Claude AI
Classifies BUY / WATCH / AVOID
4
Risk Gate
Confidence, cooldown, earnings
5
Paper Trade
Auto entry & exit, outcome tracking
6
Telegram
Signals & commands to the operator
Daily self-learning loop feeds outcomes back into scoring

The terminal

A web terminal sits on top of the whole system — total account value and its equity curve, allocation, live positions, the self-learned strategy edge and a system-health panel. It reads straight off the same store the bot writes to and refreshes on its own. (The account runs in paper / simulate mode — real logic, simulated fills.)

Trading terminal overview: total account value with equity curve, account allocation donut, live positions, self-learned strategy edge and a system-health panel.
The overview — equity curve, allocation, live positions, strategy edge and system health at a glance.

Where Claude comes in

The bot doesn't hand raw price data to a model and ask "buy or sell?" It first extracts a compact set of technical features (trend from the EMA stack, momentum from RSI, volatility from ATR, relative volume and VWAP position) and frames them as one of three named setups: breakout, EMA pullback or ribbon expansion.

Claude AI then classifies the setup into BUY / WATCH / AVOID with a confidence score and a one-line rationale. That rationale is stored with the trade, so months later I can read back exactly why the system took (or skipped) any given name.

The risk gate — the part that says no

An LLM will happily find a reason to trade anything, so its output is never the final word. Every BUY passes through a deterministic risk gate before a single simulated share is bought:

  • Confidence floor: below the threshold, the signal is dropped, not sent.
  • Cooldowns: no re-entering the same name it just churned on.
  • Sector concentration: caps how much of the book piles into one industry.
  • Earnings blackout: no fresh entries into an imminent earnings event.
  • Open-slot limits: a fixed number of concurrent positions, no exceptions.

The gate is plain, testable code. It's the deterministic guardrail around a probabilistic model.

It learns from its own trades

Every paper trade is tracked to an outcome, and a daily loop feeds those outcomes back into the scoring: per-symbol scores, per-setup win rates and confidence calibration all update from what actually happened, not from a backtest frozen in the past. The "Strategy Edge · self-learned" panel below is that loop made visible: each setup carries a live expectancy, a sample size and a trades-per-day rate.

Self-learned strategy edge with per-setup expectancy and sample size, a system-health panel, and an industry momentum heat map.
Self-learned edge per setup, data-freshness health, and an industry heat map that steers which sectors are eligible.

The entry watchlist

Candidates that clear screening are ranked by priority and confidence: expectancy per trade, the setup, current price and how each name sits relative to the leading industry. It's the shortlist the risk gate draws from when a slot opens.

Entry watchlist ranked by priority and confidence, showing setup, expectancy, industry, last price and status for each candidate.
The entry watchlist — ranked by expectancy, tagged by setup, industry and eligibility status.

Reading the regime — Risk Radar

Before it presses on individual names, the system reads the whole tape: a market-stress gauge, the current regime (trend vs. chop), the VIX fear gauge and the cross-asset risk drivers behind them. In a risk-off or choppy regime the bot fades extremes and sizes down. That context gates everything downstream.

Risk Radar: market-stress gauge, market-regime read, VIX fear gauge, stress drivers and a cross-asset risk-appetite panel.
Market stress, regime, the VIX gauge and the cross-asset drivers behind the current risk posture.

What the crowd is chasing — Most Watched

A separate feed ranks names by unusual attention (relative volume and news catalysts) and, crucially, labels the froth. High buzz with no statistical edge is tagged Froth · avoid rather than chased, keeping the bot out of crowded, edgeless moves.

Most Watched feed: symbols ranked by buzz and relative volume with news catalysts and a signal label such as Watch or Froth-avoid.
Names ranked by buzz and relative volume — with an explicit signal so froth gets avoided, not chased.

Every decision, written down

The trade journal is the memory the whole thing is built around: total trades, wins, losses, win rate, average win and loss up top, then a full log of every action with its symbol, setup, sector and the reasoning behind it. Skips are logged too, with the exact reason, so a "why didn't it buy?" always has an answer.

Trade journal: totals for trades, wins, losses, win rate and average win/loss, plus a full log of every action with symbol, setup, sector and reasoning.
The full trade journal — stats up top, then every buy, sell and skip with the reasoning attached.

Built with

PythonClaude APIyfinanceSQLitepython-telegram-botBacktestingStreamlit

Runs unattended on a mini PC, operated entirely from Telegram. The account is paper / simulate (real logic, simulated fills), so the strategy can compound and be measured without capital at risk. The code is private, but I'm happy to walk through the architecture and a live demo.

Ask me about this projectSee other projects