Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

How I Turned Broker Emails Into a Self-Updating Trading Journal

Description and use

An automated workflow converts broker confirmation emails into accurate execution events, updates the trading journal, prevents duplicates, correctly handles rolls and assignments, and routes uncertain events to a human review queue.

Problem

Broker confirmations contain fills, but converting them into accurate, non-duplicated position state is difficult due to multiple fills, partial closes, rolls, assignments, and ambiguous events.

Outcome

The system accurately reconstructs position state from broker emails, eliminates duplicate postings, preserves individual fills, correctly handles rolls and assignments, and defers uncertain events to human review, improving journal reliability.

Workflow

  • Connect Gmail inbox with read‑only access and filter by broker sender/subject
  • Run watcher every few minutes during market day
  • Retrieve matching emails and extract fields via registry‑driven parser
  • Normalize each email into a single execution event with explicit semantics
  • Validate event fields and deduplicate using Gmail message ID and execution fingerprint
  • Match event against current open positions and apply state transition (open, close, roll, assignment)
  • If event is ambiguous or fails validation, create review item in journal UI
  • Persist valid events to journal API using short‑lived surrogate key
  • Update position state and dashboards
  • Repeat

Evidence

Broker confirmations already contain the fills. The engineering challenge is turning those emails into trustworthy position state without duplicating trades, guessing at ambiguous events, or mishandling rolls and assignments.

Source

The watcher uses read-only Gmail access. It first narrows the mailbox with sender and subject rules, then retrieves only matching messages.

Source

If the broker confirms a valid close but the open premium is zero or unknown, record the close at the verified execution price and flag it for review.

Source

  • Record date: 2026-10-25T18:26:18.045Z