MarketDesk

Python

preview tbd!

about MarketDesk

MarketDesk posts my trades and the markets around them to Discord as they happen. It connects to my Interactive Brokers account, and when an order fills it posts an alert. Each alert says whether I opened, added to, trimmed or closed the position, with the price at that moment and, for options, the greeks and implied volatility.

Between trades, it posts snapshots of futures, sectors, currencies and my watchlist when the market opens and closes, plus the day’s headlines from Yahoo Finance, CNBC, Reuters and MarketWatch. Every Sunday night it posts the week ahead: economic releases and earnings for the stocks I follow. When a report like CPI or the jobs numbers comes out, it posts the actual figure next to the forecast with a short AI-written summary, and it does the same for earnings results. I can also pull up my positions and realized P&L, split by account, at any time with a slash command.

MarketDesk never places or changes orders. It only listens for fills and reads market data, and my trade history is stored in a database on the server it runs on.

why discord?

Discord offers me everything a frontend would for free: instant push notifications on my phone, a searchable history of every alert, slash commands as a menu, and separate channels for trades, market updates and logs. No web app to build, host or secure: the whole thing runs on a Google Cloud VM. Additionally, I wanted a way to share with friends and host meaningful discussions around market events :)

where the data comes from

  • Interactive Brokers: my fills, positions, real-time prices and option greeks
  • Yahoo Finance: futures, sectors, currencies and watchlist prices, and the backup when IB is offline
  • Finnhub, MarketWatch and Yahoo Finance: market headlines and live earnings results
  • Alpha Vantage: the weekly earnings calendar and reported EPS
  • ForexFactory and TradingView: when US economic data is released, the forecasts, and the actual numbers
  • Google Gemini: the short summaries of each release and earnings report

how it’s built

MarketDesk is written in Python. One asyncio process runs both the IB connection and the Discord bot, and trade history is stored in SQLite. If IB disconnects, it reconnects on its own and pings me if it’s been offline for more than five minutes. Warnings and errors go to their own Discord channel, so I usually know something broke before I’d notice it myself. Every change goes through automated tests and moves from dev to stable before I sign off on it going to main. It runs 24/7 on GCP!