How I Turned Broker Emails Into a Self-Updating Trading Journal
说明与用途
自动化工作流将经纪人确认邮件转换为准确的执行事件,更新交易日志,防止重复,正确处理滚动和指派,并将不确定事件转入人工审核队列。
问题
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.
结果
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.
工作流
- 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
证据
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.
The watcher uses read-only Gmail access. It first narrows the mailbox with sender and subject rules, then retrieves only matching messages.
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.
- 记录日期: 2026-10-25T18:26:18.045Z