Every 5 minutes
Log trading alert emails to a sheet and Telegram
Each TradingView alert email is logged with ticker, action and price in your sheet and pushed to your Telegram within minutes.
- Runs
- Every 5 minutes
- Apps
- Google Sheets, Telegram
- AI
- Not needed
- Access
- Sheets read+write; Telegram bot token
Send this to your assistant
Create a ClickRuntime automation: every 5 minutes, check my Gmail for TradingView alert emails, log the ticker, action and price in my Trades sheet and send each one to my Telegram.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
An active trader sets price alerts on a dozen tickers. The alerts arrive as emails that get buried under newsletters, and by the time they are spotted the move has happened. Looking back at which alerts fired, and when, means searching the inbox.
Routing each alert to Telegram puts it on the lock screen, and logging it to a sheet builds a record of every signal. That record is what makes it possible to review which setups were worth acting on.
What you get out of it
Alerts you actually see
A Telegram message stands out where an email does not. You react to the signal while it still matters.
A clean history of every signal
Each alert becomes a row with time, ticker, action and price. Reviewing a strategy starts from data instead of memory.
Inbox stays for email
Alerts no longer compete with newsletters and receipts. You can filter or archive them in Gmail without losing anything.
Easy to compare with your trades
With alerts in a sheet, you can put your fills next to them. Gaps between signal and action become visible.
How it works
What happens, step by step
Every 5 minutes, ClickRuntime checks your Gmail for new TradingView alert emails.
It skips any alert it has already handled, so nothing is logged twice.
It reads the ticker, action and price from each alert and adds a row to your Trades sheet.
Each alert is also sent to you on Telegram.
Before it runs live
- Connect your Google Sheets account and pick the spreadsheets it may use
- Connect Telegram
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Google Sheets and Telegram steps into one automation
Under the hood
The code that runs this automation
import re
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, state, report_fetched
SHEET_ID = "your-spreadsheet-id"
@on_trigger
def run(event):
creds = Credentials(credentials.connection("google", "work"))
gmail = build("gmail", "v1", credentials=creds, cache_discovery=False)
seen = state.get("seen") or []
ids = [m["id"] for m in gmail.users().messages().list(userId="me", q="from:noreply@tradingview.com newer_than:1d").execute().get("messages", [])]
new = [i for i in ids if i not in seen]
report_fetched(len(new))
if not new:
return {"new": 0}
rows, api = [], f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}"
for mid in new:
snippet = gmail.users().messages().get(userId="me", id=mid, format="metadata").execute()["snippet"]
m = re.search(r"(BUY|SELL)\s+(\S+)\s+at\s+([\d.]+)", snippet, re.I)
action, ticker, price = m.groups() if m else ("?", "?", "?")
rows.append([event.get("scheduled_time", ""), ticker, action.upper(), price])
http.post(f"{api}/sendMessage", json={"chat_id": "your-chat-id", "text": f"{action.upper()} {ticker} at {price}"})
build("sheets", "v4", credentials=creds, cache_discovery=False).spreadsheets().values().append(
spreadsheetId=SHEET_ID, range="Trades!A:D", valueInputOption="USER_ENTERED", body={"values": rows}).execute()
state.set("seen", (seen + new)[-500:])
return {"new": len(new)}FAQ
Common questions
Which emails does it pick up?
What if the alert text has a custom format?
Is there a delay compared with the alert itself?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Get a Telegram message when a Google Sheet gets a new row
Every 5 minutes ClickRuntime checks a Google Sheet and sends a Telegram message for each new row, such as a form response or order, with the columns you pick.
See how it worksSend a weekly Telegram message to every chat in a sheet
Write your announcement once in a sheet and every Telegram chat on your list gets it on Monday morning, with each one marked as sent.
See how it worksGet Telegram alerts when a site in your sheet goes down
Every site in your sheet is checked every 5 minutes, its status is kept up to date, and you get a Telegram message when one goes down or recovers.
See how it worksKeep exploring
Set up “Log trading alert emails to a sheet and Telegram” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.