AI Trading System Adds LLM Reasoning and Confidence-Gated ExecutionAI Trading System Adds LLM Reasoning and Confidence-Gated Execution
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
I rebuilt my AI trading system's brain in 48 hours. It no longer matches keywords. It reasons.
Two days ago, OIL-NEWS-SYSTEM was a deterministic sentiment engine. It scanned oil headlines against a hard-coded vocabulary of bullish and bearish phrases—"production cut," "pipeline attack," "inventories draw"—and fired a trade when the signal was strong enough.
It worked. But it was blind in a specific way: it could not tell the difference between a headline about oil and a headline that mentioned oil. It could not weigh how severe a supply shock was. It could not answer the question every trader actually asks: how much does this matter?
So I ripped out the brain and built a new one.
Enter groq_brain.py.
The system now runs every headline through a reasoning model (openai/gpt-oss-20b via Groq) before a single dollar moves. It returns structured output:
Is this actually about oil? (Binary gate. Filters noise.)
Impact: BULLISH / BEARISH / NEUTRAL
Strength: 1–5, where 5 is "war, embargo, major supply shock"
Confidence: 0.0–1.0
A trade only fires above a confidence threshold. A circuit breaker catches API failures and falls back to the original deterministic engine—so the system never goes dark, it just gets dumber for a cycle instead of dying.
The architecture, stripped of marketing:
📡 twitter_monitor.py — polls target accounts every 20 seconds, primes on first poll, never trades stale news.
🧠 groq_brain.py — the new reasoning layer. Structured JSON out. Confidence-gated.
⚙️ sentiment.py — the original keyword engine, now the fallback, not the primary.
⚡ main.py — Binance Futures execution on BZUSDT. Leverage, position sizing, stop-loss, take-profit, rate-limit handling, reconnection logic.
🐳 Dockerized. Python 3.11. One docker run and it's live.
Cost to run: $0. No paid APIs in the critical path. No managed cloud. No subscriptions.
I also generated a 30-second film for it—entirely AI, no real footage. Fire, an empty room, a machine reasoning through a headline, and a trade executing without a human in the chair. It is the closest thing to seeing the system think.
🎥 Watch it. Then read the code.
If you're building autonomous systems and need an execution layer that actually ships—or you want to see what a real reasoning pipeline looks like before you hire someone to build yours—my inbox is open.
#AITrading #Python #Automation #LLM #BuildInPublic #QuantDev #FinTech #AI #king_AI
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started