Skip to content

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.

Paste it into your assistant. It tells you what it will send or change before it runs live.

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

  1. Every 5 minutes, ClickRuntime checks your Gmail for new TradingView alert emails.

  2. It skips any alert it has already handled, so nothing is logged twice.

  3. It reads the ticker, action and price from each alert and adds a row to your Trades sheet.

  4. 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

RunsEvery 5 minutes
Log trading alert emails to a sheet and Telegramtoday, 9:00Succeeded
Telegram · Trading alertsBUY ACME at 42.15 (alert: breakout above 42)

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
trading_alert_emails_to_sheet_and_telegram.pyexample
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?
Messages from TradingView's alert address that arrived since the last check. You can narrow it to a label or subject keyword if you use several alert sources.
What if the alert text has a custom format?
The ticker, action and price are read from the alert message you set up in TradingView. Keeping a consistent format such as "BUY AAPL at 182.50" gives the most reliable rows.
Is there a delay compared with the alert itself?
The inbox is checked every 5 minutes, so an alert can take up to that long to reach Telegram. For faster delivery, TradingView can send alerts directly to a trigger link instead.
What permissions does it need?
Sheets read+write; Telegram bot token. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it checks. Checks that find nothing new and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

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.