Watchlists & alert hygieneIntermediate#alerts#journaling#weekly-review#data-quality#python

Export your TradingView alert log before it's cleared and note what you did

TradingView clears old alert triggers from the log, so once a week you export it to CSV. A script converts times to your zone and matches each trigger to your journal, and you add a one-line note on what you did and why.

How it works

  1. Once a week, open the Alerts panel in your own TradingView account, switch to the Log tab and export it to CSV. TradingView's help pages say old triggers are deleted automatically, so a weekly export keeps the record complete.
  2. Save the file with the export date in its name in a folder your script reads. Keep every raw export unchanged.
  3. A Python script loads the new export, drops triggers already stored, converts the timestamps (the help pages say alert times are shown in UTC) to your local zone, and appends the new rows to an alert history sheet.
  4. For each trigger the script looks for a journal row for the same position label within a window you set, for example the same session, and marks it matched or unmatched.
  5. You add a short note to each trigger: acted per plan, ignored per plan, or no plan. An agent then counts triggers by note type and lists alerts that fired three or more times with no plan, for your alert clean-up.

Copy-paste prompt

Write a Python script for my weekly TradingView alert-log import. It gives no trading advice and never suggests trades.
Inputs: a folder {{exports_folder}} of alert-log CSV exports, my history sheet export {{alert_history_csv}}, my journal {{journal_csv}} (date_time, position_label, action) and my time zone {{tz}}.
1. Read the newest export and print its column names before doing anything else, so I can confirm the mapping.
2. Convert trigger times from UTC to {{tz}} with zoneinfo.
3. Skip triggers already in the history (same alert name and trigger time).
4. For each new trigger, mark matched if the journal has a row for the same position label within {{match_window_hours}} hours, else unmatched.
5. Write the new rows to a CSV for me to paste, with an empty note column. Never edit the raw exports.
Include two test rows I can check by hand.

Guardrails

  • The log is a record of your own alerts; the agent never interprets what a trigger means for the market.
  • Raw exports are kept unchanged and new rows are only added after you check the column mapping.
  • Notes are written by you; the agent only counts them and lists alerts with no plan.

What can go wrong

The first import doubled some rows because an alert that fired twice in the same minute looked like a duplicate, and others went missing because two exports overlapped by a day. Keying duplicates on alert name, trigger time and message fixed both. Matching by position label also fails when your alert names don't use the same labels as your journal, so name alerts with the journal label from the start.

Why it helps

An alert firing is a moment when your plan met the market. Whether you acted, ignored it on purpose or had no plan at all is useful review data, and it disappears when the platform clears its log. A weekly export with your one-line note turns alerts into a record of your own decisions.

How it fits with other entries

Alert hygiene (aft-0004) expires and de-duplicates the alerts themselves; this entry keeps a history of what they did. Alerts with repeated 'no plan' notes are natural candidates for that clean-up, and for the reason and review date in the capped focus list (aft-0058).

Where this comes from

TradingView's help pages on managing alerts, the automatic deletion of old triggers from the log, and the time zone shown in alerts. The weekly export, matching and notes are ours.

Source and references

Original write-up by Agents for Traders, based on TradingView's public help pages linked below.

Spotted an error, or want your post removed? Email hello@agentsfortraders.com.

Educational content only. Not investment advice or a personal recommendation. No tickers, signals or trade alerts. Trading involves risk of loss.

Conteúdo exclusivamente educativo. Não constitui aconselhamento nem recomendação de investimento. Sem tickers, sinais ou alertas de negociação. Negociar envolve risco de perda.

Related use cases