Overview
Tradr is a terminal trading cockpit built with Textual. It shows live ASCII candlestick charts, a rotating watchlist of trending tickers from Yahoo Finance, and a chat console where plain commands and a Groq-backed assistant share the same input.
I built it solo, then added order handling through Alpaca (buy, sell, list and cancel orders, portfolio view) and set it up for release as a Python package with a one-line install script.
The challenge
Checking a chart, a watchlist and a broker in separate browser tabs breaks focus, and most terminal tools only do one of those things. Terminal charts also have to redraw cleanly and follow the app theme, which ordinary plotting libraries do not handle.
Adding an AI assistant raises a design question too: typed commands and free-form questions need to live in one input without confusing each other.
The goal
Put charting, a watchlist, an assistant and trading in one keyboard-driven screen.
- 01Draw live candlesticks in the terminal that refresh by themselves and follow the light or dark theme.
- 02Keep a watchlist of trending tickers that rotates through a cached universe.
- 03Combine quick commands with an AI chat in a single console.
- 04Place and manage orders and see the portfolio from the same screen.
Chart and watchlist
The chart widget renders Plotext candlesticks inside Textual and redraws on a timer. The watchlist is sourced from Yahoo Finance screeners and scrolls with keyboard focus. Chart data first came from yfinance and was later moved to Alpaca when trading was added.
Commands and the AI console
The console accepts commands such as chart, watch, analyze, set-key and about, and anything else goes to a Groq-hosted assistant guided by a prompt file. The Groq key can be set from inside the app with set-key and is cached for the next launch. Pressing d toggles the theme.
Orders and install
A later set of commits added buy, sell, order listing, order cancelling and a portfolio view through Alpaca. For distribution there is a PyPI publish workflow and an install script for Linux and macOS that installs dependencies with uv and sets up the entry points.
The outcome
Tradr is a working terminal app with a PyPI publish workflow and an install script, still labelled beta in its own version notes. It shows I can build a full interactive TUI, integrate market data, a broker API and an LLM, and package it for others to install.


