StockGram
StockGram by Page Telegram Volunteer Services
!
StockGram demo
A terminal portfolio watcher written in Bash. Add and remove stock tickers, set how many shares you hold, watch live up/down moves and a running asset total, open ASCII price charts (intraday through 10 years), and read per-stock RSS headlines β including a text preview and a Shift+Enter article dialog.
Prices and history come from Yahoo Finance public chart APIs. Headlines come from Yahoo Finance RSS, with Google News as a fallback. This is not investment advice.
Requirements
| Tool | Purpose | Typical package |
|---|
python3 | Quotes, ASCII charts, RSS parse (stdlib only) | python3 |
curl | Ticker validation | curl |
mkdir | Config and cache dirs | coreutils |
tput | Terminal size | ncurses / ncurses-bin |
stty | Keyboard TUI | coreutils |
No pip packages. On first run, StockGram checks for missing tools and prompts to install them (
apt,
dnf,
yum,
zypper,
pacman,
apk, or
brew).
bash
./stockgram.sh --check-deps
./stockgram.sh --install-deps
Non-interactive installs:
STOCKGRAMASSUMEYES=1 ./stockgram.sh --install-deps
Run
bash
chmod +x stockgram.sh
./stockgram.sh
macOS app
The only file you need on a Mac is
StockGram.app. Unzip
OSX/StockGram.app.zip and double-click the app. The Bash TUI is embedded in the bundle (
Contents/Resources/stockgram.sh); you do not need a copy of
stockgram.sh next to the app.
Use the zip, not a raw folder copy off pCloud β pCloud drops Unix execute bits, and macOS will not launch an app whose executable is not
+x. First launch on a new Mac: right-click the app β
Open (unsigned). StockGram still needs Bash 4+ (
brew install bash).
One-shot dumps (no TUI):
bash
./stockgram.sh --help
./stockgram.sh --quotes AAPL,MSFT,TSLA
./stockgram.sh --news AAPL
./stockgram.sh --chart AAPL 1d line
./stockgram.sh --chart AAPL 10y ohlc
Chart ranges:
1d 5d 1mo 3mo 6mo ytd 1y 2y 5y 10y
Chart styles:
line area ohlc
Portfolio window
The top pane is the watchlist. Each row shows last price, share count (
SHRS), a live
UP / DN dollar move versus the previous close, percent change, and (when the terminal is wide enough) position
VALUE, volume, day range, 52-week range, and an ASCII intraday sparkline.
The last line of the portfolio box is a running
ASSETS total: number of positions, market value, and day P/L. Tickers with no shares set are watch-only and do not count toward the total.
| Key | Action |
|---|
β β or j k | Select ticker (loads that symbolβs news) |
c / C or Enter | Open the fullscreen ASCII chart |
s | Set share count for the selected ticker |
Space | Pause / resume auto-updates (quotes, news, charts) |
G | Sort the list by biggest day gains (%) |
a | Add call letters |
x or Delete | Remove the selected ticker |
u / U | Quote refresh interval, 2 seconds to 1 hour |
R | Refresh quotes and news now |
? | Help |
q | Quit |
Default watchlist (first run):
AAPL MSFT GOOG AMZN NVDA TSLA META SPY QQQ
Saved in
~/.config/stockgram/watchlist (or
$STOCKGRAM_HOME/watchlist). Each line is a symbol, optionally followed by a share count:
AAPL 12
MSFT 5.5
GOOG
AAPL=12 and
AAPL:12 are also accepted. Override the config directory with
STOCKGRAM_HOME.
News window
The bottom pane is a separate boxed window. It shows RSS headlines for the
selected ticker only: date and source, the title, and a short
text preview from the feed description.
| Key | Action |
|---|
β β | Previous / next headline |
Home / End | First / last headline |
Shift+Enter or o | Open the article in a dialog (fetched body, or RSS text if the page cannot be read) |
In the article dialog:
β β or
j k scroll,
PgUp /
PgDn /
Space page,
q or
Esc close.
The feed auto-refreshes
every 1 minute. The title bar shows source,
auto 1m, and age (
12s ago). Your place in the list is kept across refreshes. If the feed fails, the last headlines stay on screen.
Chart view
ASCII only (line, area, or OHLC). History from 1 day through 10 years.
| Key | Action |
|---|
β β | Pan (scroll history) |
Home / End | Oldest / live follow (newest) |
+ = / - | Zoom in / out |
[ ] | Shorter / longer range |
1β9, 0 | 1D 5D 1M 3M 6M YTD 1Y 2Y 5Y / 10Y |
c | Cycle style: line, area, ohlc |
n / p | Next / previous ticker |
Space | Pause / resume auto-updates |
u / U | Quote refresh interval |
q or Esc | Back to the portfolio |
Quote refresh (
u/
U) is independent of the 1-minute news timer.
Space freezes both. While paused, the last quotes and chart stay on screen; pan, zoom, and range keys still fetch a new chart if you change the view.
Refreshes paint
in place (no full-screen wipe), so a 2-second quote interval no longer makes the terminal flash.
Responsive layout
List, news, and charts scale to the terminal. Resize redraws immediately. The header shows size and density, for example
80x24 normal.
| Density | Typical size | Behavior |
|---|
| compact | under 64 columns or 18 rows | Short header, no sparkline, 1-line footer |
| normal | around 80Γ24 | Sparkline, balanced list and news |
| wide | 120Γ30 and up | Longer names, position value, volume, day range, taller news |
Environment
| Variable | Meaning |
|---|
STOCKGRAMHOME | Config directory (default: ~/.config/stockgram) |
STOCKGRAMASSUMEYES | Install missing packages without a prompt |
NOCOLOR | Disable ANSI colors |
Cache files live under
${TMPDIR:-/tmp}/stockgram-$UID.
Demo GIF
A recorded walkthrough lives at
docs/stockgram-demo.gif. It shows the portfolio list, news pane,
G (sort by gains), and a fullscreen ASCII chart.
Regenerate it (needs live market data,
python3 +
pyte,
ffmpeg, and DejaVu Sans Mono):
bash
python3 tools/record_demo.py
Disclaimer
Market data is delayed or last-sale as provided by Yahoo Finance. Feeds can be incomplete or unavailable. StockGram is a volunteer terminal tool, not a broker, and not investment advice.