Stock watchlist threshold alerts in Slack
Watch your tickers from a Google Sheet and get a Slack alert the moment any price crosses your upper or lower limit, every 15 minutes during US market hours.
Build me a code workflow that watches a Google Sheets watchlist of stock tickers and posts a Slack alert any time a price crosses one of my preset thresholds. Pure deterministic plumbing, no judgement calls.
Trigger: cron every 15 minutes, Monday through Friday, between 9:30am and 4:00pm US Eastern time. Do not run on weekends or outside that window.
Inputs the workflow needs from me at setup: the Google Sheets spreadsheet ID, the watchlist tab name (default 'Watchlist'), the alert-history tab name (default 'AlertHistory'), the Slack channel ID to post to, and the cooldown in minutes (default 60).
Step 1. Use Google Sheets Get Values to read the watchlist tab. The sheet has a header row and these columns: Ticker, UpperLimit, LowerLimit, LastAlertedAt. Skip the header. For each row, parse UpperLimit and LowerLimit as numbers and LastAlertedAt as an ISO timestamp (may be blank).
Step 2. For each watchlist row, skip the ticker if LastAlertedAt is within the cooldown window (now minus cooldown minutes). Otherwise, call Real-Time Finance Data Get Stock Quote for that ticker and read the current price from the response.
Step 3. Compare the live price to the row's limits. If price is greater than or equal to UpperLimit, treat it as an upper-limit crossing. If price is less than or equal to LowerLimit, treat it as a lower-limit crossing. Otherwise, no alert for this ticker.
Step 4. For every crossing, use the Slack Bot Send a Message operation to post to the configured channel. Format the message as a single line like 'AAPL crossed upper limit: 198.40 vs 195.00' or 'TSLA crossed lower limit: 174.22 vs 180.00'. Include the ticker, direction, current price, and the threshold.
Step 5. For every crossing, use Google Sheets Append Values on the alert-history tab to append a row with: timestamp (ISO, UTC), ticker, direction ('upper' or 'lower'), price, threshold. This is the auditable log.
Step 6. After alerting for a ticker, also write the current timestamp back into that ticker's LastAlertedAt cell on the watchlist tab so the cooldown check on the next run works. Use a targeted range update on just that cell, not a rewrite of the whole sheet.
Error handling: if Get Stock Quote fails for one ticker (unknown symbol, rate limit, transient error), log it and continue with the remaining tickers. One bad ticker should not break the run.
Use the Slack Bot integration (xoxb token) for posting, not user-OAuth Slack, since these are automated alerts to a channel and should appear as a bot.
Additional information
What does this prompt do?
- Reads your watchlist from a Google Sheet (Ticker, upper limit, lower limit) so you can manage tickers and price targets without touching the workflow.
- Pulls a live quote for every ticker and posts a Slack alert the moment a price crosses one of your thresholds, with the current price and the limit it broke.
- Logs every alert to a history tab in the same sheet so you have an auditable record and can see how often each ticker fires.
- Skips any ticker that already alerted in the last hour, so a price hovering near a threshold does not spam your channel.
What do I need to use this?
- A Google account with access to a sheet that lists your tickers, upper limit, lower limit, and an alert-history tab.
- A Slack workspace and a channel where you want price alerts posted.
- A Real-Time Finance Data account (free tier works for a small watchlist) for the live stock quotes.
How can I customize it?
- Change the schedule: tighten it to every 5 minutes, loosen it to every half hour, or run it only during pre-market or after-hours.
- Adjust the cooldown: shorten or lengthen the quiet period after a ticker alerts so a hovering price does not flood your channel.
- Pick a different destination: post each alert to a private channel, a DM, or route urgent breaks to a separate channel for big swings.
- Add richer thresholds: alert on percentage moves from yesterday's close, or only when a ticker breaks a threshold by more than a buffer you set.
Frequently asked questions
Do I need a paid Real-Time Finance Data plan?
How do I add or remove tickers?
Will it spam my Slack channel if a price hovers near a limit?
Can I track indices, ETFs, or crypto, not just stocks?
What happens outside US market hours?
Stop staring at price charts.
Connect Google Sheets, Slack, and Real-Time Finance Data once, and Geni watches your watchlist every 15 minutes for you.