Free & open source · paper trading by default

Your own AI trading bot, running on your server.

Charles screens the market, reasons over every candidate with a large language model, and places trades on its own — around the clock, on a server you control. Watch it from a live dashboard and get every move on Telegram.

Runs on Alpaca's paper-trading account by default — simulated orders, no real money. Live trading is optional and entirely your call. Not financial advice.

root@charles: ~
$ git clone https://github.com/nswansonprojects/charles.git $ charles-start ✅ Charles started · dashboard on :8501 $ charles-logs 09:30:02 🌅 Morning routine 09:30:04 🔍 Screener ranked 10 candidates 09:30:05 🌡️ Regime: TRENDING_BULL 09:30:11 🧠 NVDA → BUY conf 0.72 09:30:11 🎯 Trailing stop set (ATR×2) 09:30:12 📱 Telegram alert delivered 09:45:00 🛡️ Stops checked · 4 positions
What it does

A whole trading loop in one process.

Screen, reason, decide, protect, report — Charles handles every step and keeps doing it whether you're watching or not.

Builds its own watchlist

Scores a universe of liquid stocks on momentum, volume, RSI, moving averages and strength vs SPY, then picks the day's best setups — no hand-fed tickers.

Explains every decision

Each candidate goes to an LLM (via Groq) with its technicals and news. It answers BUY, SELL or HOLD with a confidence score and a written reason, all logged.

Layered risk controls

Trailing stops, an earnings blackout, a market-regime filter and a daily-loss kill switch all run automatically on every cycle.

Live dashboard

A web dashboard on your server shows positions, P&L, the equity curve, signals and the decision log — from any browser, including your phone.

Telegram alerts

Every buy, sell, stop and error is pushed to your phone, plus a regular heartbeat so you know it's alive.

Runs 24/7, restarts itself

Installed as a system service: it starts on boot, comes back after a crash, and keeps a full log you can tail any time.

Dashboard

See everything, from any device.

The dashboard runs on port 8501 of your server. These are screenshots from a running instance.

Charles dashboard, equity tab: portfolio value, return, cash and the equity curve with trade markers
Equity. Portfolio value, return, cash and buying power, with the equity curve and every trade marked. The side panel shows the market regime, today's P&L, the kill-switch level and the watchlist.
Charles dashboard, signals tab: RSI, MACD, Bollinger position and volume for each watchlist stock
Signals. RSI, MACD, Bollinger position, volume confirmation, multi-timeframe flags, ATR and upcoming earnings for every stock on the watchlist — the raw inputs behind each decision.
How it works

From GitHub to a running bot in four steps.

About 30 minutes, most of it waiting for installs. The setup guide walks through every command.

Get the code

Charles lives on GitHub. Read it, fork it, star it — it's all yours.

Start a server

Create a small Ubuntu droplet on DigitalOcean and run the one-line installer.

Add your keys

Free Alpaca paper and Groq keys (Telegram optional) go into a .env file.

Run & watch

charles-start, finish the short setup page, then follow along on the dashboard.

How Charles trades

A disciplined swing trader.

Charles holds positions for days, enters only when several signals agree, and always has an exit plan.

Multi-signal entries

A buy needs agreement: trend above the moving averages, RSI in the momentum zone, MACD confirming, volume above average, and the stock beating the market.

Market regime first

Before any buy it reads the market's temperature — SPY trend, choppiness and volatility. In a confirmed downtrend it stops opening new positions.

Reasoned, logged decisions

The LLM sees technicals, news sentiment, the position and how long it's been held, and returns a decision with confidence. Low-confidence calls are ignored.

Exits that run themselves

ATR-based trailing stops, earnings protection, a stale-trade cutoff and a daily-loss limit that halts trading for the day.

Be realistic. In the project's own backtests the strategy has trailed simply buying and holding during strong bull markets; its clearest edge so far has been losing less in downturns. Treat it as a research project you can study and improve, not a money machine.
Make it yours

Change the bot by asking in plain English.

Install Claude Code on the same server and work on Charles in conversation: ask why it skipped a trade, tighten a stop rule, add a Telegram report, or explain a file. It reads the code and logs, makes the change, and can restart the bot for you.

How to set it up →
~/charles — claude
› Why didn't Charles buy anything today? Read logs/bot.log · Read config.py Regime was RANGING, so buys needed 65% confidence. 3 BUY signals came in at 55–62% and were filtered. › Lower that to 62% and restart. Edit config.py · Bash charles-restart ✓ Done — restarted, Alpaca & Groq OK.
Open source

Free, on GitHub, yours to run.

No account, no subscription, no license key. Clone it, run it on your own server, and change anything you like.

  • Full source — read and modify every line
  • Autonomous screener + LLM reasoning
  • Dashboard and Telegram alerts
  • Paper trading by default, live optional
  • Self-hosted: your server, your keys, your data

Charles places simulated orders on Alpaca's paper account until you deliberately connect live keys. It makes no profit guarantees in any mode, past or simulated results don't predict real ones, and nothing here is financial advice. You're responsible for how you use it.