Skip to content

Every 5 minutes

Log TradingView alert emails to a Google Sheet

Every TradingView alert email becomes a row in your Signals sheet with the ticker, buy or sell signal and price.

Runs
Every 5 minutes
Apps
Gmail, Google Sheets
AI
Not needed
Access
Gmail gmail.readonly; Sheets read+write

Send this to your assistant

Create a ClickRuntime automation: every 5 minutes, check my Gmail for TradingView alert emails, pull out the ticker, action and price, and add them to my Signals sheet.

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

A part-time trader runs a dozen alerts that fire by email through the day. The emails pile up in the inbox, and at the end of the week there is no easy way to see which signals fired, when, or whether they were any good.

This automation reads each new alert email, pulls out the ticker, signal and price, and adds a row to a Google Sheet. The inbox stops being the record, and the sheet becomes a history you can sort, chart and review.

What you get out of it

  • A complete signal history

    Every alert is logged with its time and price, so you can look back at what fired and judge how a strategy performed.

  • Sort and filter like any sheet

    Once alerts are rows, you can filter by ticker, count signals per week or add a column for the outcome of each trade.

  • Nothing is missed in a busy inbox

    Alerts that arrive while you are away are still logged, in order, within minutes.

  • Plain rules, no guesswork

    The fields are read from the email text with fixed patterns, so the same email always produces the same row.

How it works

What happens, step by step

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

  2. It reads the ticker, the buy or sell signal and the price from each alert.

  3. Emails it has already logged are skipped.

  4. Each alert is added as a new row in your Signals sheet with the time it arrived.

Before it runs live

  • Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
  • Connect your Google Sheets account and pick the spreadsheets it may use

What you get

RunsEvery 5 minutes
Log TradingView alert emails to a Google Sheettoday, 9:00Succeeded
Google Sheets · Signals2026-10-19 14:05 · NVDA · buy · 131.20

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 Gmail and Google Sheets 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.
log_trading_alert_emails_to_a_sheet.pyexample
import re
from datetime import datetime, timezone
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, state, report_fetched
SHEET_ID = "your-spreadsheet-id"
PATTERN = re.compile(r"\b([A-Z]{1,6})\b.*?\b(buy|sell)\b.*?([0-9]+(?:\.[0-9]+)?)", re.I | re.S)

@on_trigger
def run(event):
    creds = Credentials(credentials.connection("google", "work"))
    gmail = build("gmail", "v1", credentials=creds, cache_discovery=False)
    after = state.get("after") or 0
    msgs = gmail.users().messages().list(userId="me", q=f"from:noreply@tradingview.com after:{after}").execute().get("messages", [])
    msgs = [gmail.users().messages().get(userId="me", id=m["id"]).execute() for m in msgs]
    msgs = [m for m in msgs if int(m["internalDate"]) // 1000 > after]
    report_fetched(len(msgs))
    if not msgs:
        return {"logged": 0}
    rows = []
    for m in sorted(msgs, key=lambda m: int(m["internalDate"])):
        hit = PATTERN.search(m["snippet"])
        if hit:
            ts = datetime.fromtimestamp(int(m["internalDate"]) / 1000, timezone.utc).isoformat(timespec="minutes")
            rows.append([ts, hit.group(1).upper(), hit.group(2).lower(), hit.group(3)])
    if rows:
        build("sheets", "v4", credentials=creds, cache_discovery=False).spreadsheets().values().append(
            spreadsheetId=SHEET_ID, range="Signals!A:D", valueInputOption="USER_ENTERED", body={"values": rows}).execute()
    state.set("after", max(int(m["internalDate"]) // 1000 for m in msgs))
    return {"logged": len(rows)}

FAQ

Common questions

What does the alert message need to contain?
The ticker, the action such as buy or sell, and the price, in a consistent order. Setting your alert message to something like 'AAPL buy 187.40' makes it easy to read.
Will an alert be logged twice?
No. Each email is logged once, and later checks only look at emails that arrived after the last one handled.
Can I log alerts from other senders?
Yes. Any alert service that sends emails in a consistent format can be added by its sender address.
What permissions does it need?
Gmail gmail.readonly; Sheets read+write. 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 TradingView alert emails to a Google Sheet” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.