Skip to content

Insider / Form 4 parser — management buy/sell signals from SEC filings #25

@DogInfantry

Description

@DogInfantry

Summary

Add a Form 4 parser that extracts insider transaction data from SEC EDGAR and surfaces management buy/sell signals in the research note.

Motivation

Insider transactions are public, free, high-signal, and ignored by the vast majority of open-source finance repos. Including Form 4 signals in the evidence blocks makes the note look institutional rather than dashboard-like, and requires no paid data source — only the existing SEC EDGAR connection.

Proposed Architecture

trg_workbench/filings/
└── form4_parser.py
    - fetch_form4(ticker, lookback_days=90) -> list[InsiderTransaction]
    - classify_transaction(t) -> signal: 'strong_buy' | 'buy' | 'sell' | 'strong_sell'
    - aggregate_insider_score(transactions) -> float  # -1.0 to +1.0

Outputs per Ticker

{
  "insider_score": 0.62,
  "transactions": [
    {
      "filer": "Tim Cook",
      "role": "CEO",
      "type": "Purchase",
      "shares": 50000,
      "value_usd": 9200000,
      "date": "2026-03-12",
      "signal": "strong_buy"
    }
  ],
  "net_shares_90d": +125000,
  "cluster_buy": true
}

Signal Logic

  • Cluster buy (3+ insiders buying in 30 days) = strong positive signal
  • CEO/CFO open-market purchase = high-conviction positive
  • Routine 10b5-1 sale = neutral (flag as plan sale, not discretionary)
  • Non-plan sale by C-suite = negative signal

Acceptance Criteria

  • form4_parser.py fetches Form 4 XML from SEC EDGAR for a given ticker
  • Parses filer name, role, transaction type, shares, value, and date
  • Distinguishes 10b5-1 plan sales from discretionary transactions
  • Aggregate insider score (-1 to +1) computed and surfaced in HTML note
  • Transaction table rendered in the note's Insider Activity section
  • Unit tests with fixture Form 4 XML (no live SEC calls in CI)
  • Module skipped gracefully if no Form 4 found in lookback window

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions