Roger Mendoza

A market newsroom on autopilot: macro charts, AI commentary and the guardrails

How the GammaJuice pipeline turns a nightly scan into charts, posts and articles — FRED macro data, an AI that writes in my voice under strict rules, and P&L tracking that shows the losers too.

A GammaJuice weekly squeeze chart with Bollinger and Keltner bands, targets and a forecast line

The 3WT squeeze scanner finds setups. The gamma pipeline is everything that happens after: charts, social posts, macro context, articles and a running scorecard. It's a small newsroom made of Python scripts, and it publishes most days without me touching it.

Education and research, not investment advice.

Every signal gets its own chart

Each spotlighted signal gets a chart built from scratch: weekly candles, Bollinger Bands and Keltner Channels (the squeeze is the first inside the second), a momentum histogram, the price targets, and a forecast line from Kronos — an open-source forecasting model for price bars — that feeds a confidence re-score. The chart says what the post says, so a reader can check the claim against the picture.

Macro context from FRED

A separate module pulls economic series from the Federal Reserve's FRED database — the 10-year and 2-year Treasury yields, the Fed funds rate, CPI, the S&P 500 — and turns them into context posts: the rate environment, inflation against policy, the index against its 50- and 200-day averages.

Two engineering details mattered more than the charts:

  • Graceful failure. FRED calls retry with backoff and fall back to a cached copy when the API is down. If the AI service is unavailable, a plain fallback caption is used instead of a broken post.
  • A memory of what was posted. A small history file records every topic and angle, so the pipeline doesn't post the same yield-curve chart three days running.

AI commentary, with a rulebook

Post text is written by an LLM through OpenRouter, in what the code literally calls "Roger voice". The interesting part is the rulebook, not the model:

  • Sound like a trader, not an analyst or a bot.
  • No hashtags, rarely emojis, no "today" or dates that go stale in a queue.
  • Be specific about levels and setups.
  • Occasional humility: admit when setups don't work.
  • 220–270 characters, and return only the post.

Every number in the prompt — entry, current price, targets, squeeze streak — comes from the database, so the model writes around facts rather than inventing them. That's the same structured-output discipline I use everywhere: the model handles language; code owns the numbers.

Longer pieces go to a Ghost blog through its Admin API, using four templates — signal, macro, comparison and education — with charts uploaded through Ghost's own image API first.

A scorecard that shows the misses

Signal performance tracker
The automated performance tracker: top and worst performers since each signal was detected, side by side.

The tracker posts top and worst performers side by side, with the entry price, current price, days since detection and phase. Its footer reads "no predictions, just tracking". The worst performers are the reason anyone should believe the best ones.

Two honest caveats live in the code, and they belong in the open:

  • Some baselines were set late. When P&L tracking was added, signals without an entry price were given one equal to the price at that moment. Their P&L is measured from then, not from when they were first detected.
  • Signals decay instead of vanishing. A ticker that drops out of a scan has its score decayed rather than deleted, so the history doesn't quietly forget the ones that faded.

Filters get backtested before they ship

Proposed filters — a minimum price, a minimum average volume, valid squeeze phases, signal types, a small blacklist — are run against archived signals before they go live. Each one reports how many signals it keeps, the win rate and average P&L of what it keeps, and how many big losers it would have caught. The question every filter has to answer is whether it removes more losers than winners.

What I'd tell anyone automating content

  1. Code owns the numbers; the model owns the sentences.
  2. Write the voice down as rules. "Admit when setups don't work" is a line in a prompt, and it changes everything downstream.
  3. Plan for failure. Retries, caches and a plain fallback beat a broken post.
  4. Show the losers. It's the cheapest credibility there is.

Some links in these notes are affiliate links. If you buy through one, I may earn a commission at no extra cost to you. I only link to tools I use or would recommend.