---
name: insider_trade_tracking
description: Research insider transaction signals from SEC Form 4 filings: pull the raw ownership filings, decode transaction codes, separate opportunistic buys from routine noise, detect cluster buying, and flag the classic false positives. Use when an agent needs to investigate what corporate insiders are doing with their own stock, screen a ticker for insider conviction, or build an evidence-backed insider signal report.
---

# Insider Trade Tracking

## Purpose

Turn SEC Form 4 filings into disciplined insider signals. The raw data is free and near real time, but most filings are noise. This skill's job is signal vs noise: keep the open-market conviction buys, discard the grants, tax withholding, and option exercises, and report what survives with evidence.

This is a research workflow. It produces an evidence-backed signal report, never a buy recommendation.

## Workflow

### 1. Scope the target

Ticker or company name. Resolve to a CIK and pull the recent Form 4 index:

```bash
python3 bin/fetch_form4s.py TICKER --count 20
```

This hits the free SEC EDGAR JSON API directly (no key; a descriptive User-Agent header is required and the API caps at 10 req/sec). Output is filing dates, report dates, accession numbers, and direct Archives URLs.

### 2. Read the raw ownership XML

The primary document in the index is an XSL-rendered page. For machine reading, fetch `form4.xml` from the filing directory root instead, e.g.:

```
https://www.sec.gov/Archives/edgar/data/<CIK-no-leading-zeros>/<accession-no-dashes>/form4.xml
```

The schema is `<ownershipDocument>`: `<issuerTradingSymbol>`, `<rptOwnerName>`, `<reportingOwnerRelationship>` (isOfficer, isDirector, isTenPercentOwner, plus the officer title), and one or more `<nonDerivativeTransaction>` / `<derivativeTransaction>` blocks. The fields that matter per block: `<transactionDate>`, `<transactionCode>`, `<transactionShares>`, `<transactionPricePerShare>`, `<sharesOwnedFollowingTransaction>`, and `<explanationResponses>` footnotes.

### 3. Classify by transaction code

Keep only what signals conviction. Full code table lives in `references/transaction-codes.md`.

- **Keep: `P`** (open market or private purchase). The insider spent their own cash. This is the entire signal.
- **Discard as noise:** `A` (grant/award), `F` (shares withheld for tax on vesting), `M`/`X`/`C` (option exercises and conversions), `G` (gift), `D` (disposition back to issuer), `L` (small acquisition). A filing full of `F` codes after an `A` is compensation plumbing, not sentiment.
- **Sales (`S`)**: mostly uninformative. Insiders sell for taxes, diversification, liquidity, and scheduled plans. Research finds purchases predict returns; sales do not. Never read a sale as a bearish signal on its own.

### 4. Split opportunistic from routine

Following Cohen, Malloy, and Pomorski (2012, Journal of Finance): a trade is **routine** if that insider traded in the same calendar month in each of the three preceding years. Everyone else with sufficient history is **opportunistic**. The predictive power lives entirely in the opportunistic group; routine trades earn roughly nothing. Implementation: pull the insider's filing history (same owner CIK or name search via the EDGAR full-text search, `https://efts.sec.gov/LATEST/search-index`) and check the monthly pattern. An irregular, off-calendar buy predicts; a clockwork annual buy does not.

### 5. Detect clusters

A cluster is 2+ distinct insiders (stronger at 3+) making open-market `P` buys in the same ticker within a 14 to 30 day window. Cluster buys carry roughly double the signal of a lone buy. Independent directors are the cleanest members: they usually have no comp tied to short-term price, so several directors writing personal checks at once is an honest vote of confidence. Check the reportingOwnerRelationship flags to confirm roles.

### 6. Weight what survives

For each surviving buy, record: role (CEO/CFO/Chair beats other officers beats directors beats 10% holders, who are often funds), dollar value (shares x price), the buy's size vs the insider's total holdings and vs their compensation, and whether they bought into weakness. A CFO buying $500K on a dip says more than a token 100-share purchase.

### 7. Clear the false-positive traps before reporting

- **Rule 10b5-1 plan.** Since the SEC's December 2022 amendments (effective February 2023), Form 4 filers must check a box when the transaction was made under a Rule 10b5-1(c) plan, and footnotes disclose plan adoptions. A planned buy is scheduled, not a fresh conviction vote. Check the box and the footnotes.
- **Tax withholding (`F`).** The single most common false positive: shares withheld at vesting look like sales.
- **Option exercise paired with immediate sale (`M` then `S`).** Compensation realization, not a sentiment read.
- **Form 4/A amendments.** Late corrections and additions; dedupe against the original filing.
- **Deemed execution dates** vs transaction dates: settlement mechanics can shift apparent timing; use the transaction date.

## Output Contract

Deliver a signal report with these fields, one row per surviving transaction, then a cluster section:

```
TICKER / company / CIK
  Insider | Role | Code | Txn date | File date | Shares | Price | $ value
  % of insider's holdings | Opportunistic or Routine | Traps cleared (10b5-1 / tax / amend)
  Filing URL
CLUSTERS: members, window, combined $ value, verdict
VERDICT: one paragraph. What the evidence supports, what it does not.
```

Every row cites its filing URL. If nothing survives the filters, say so plainly. An empty report is a correct report.

## Operating Rules

1. Every factual claim gets a source: the filing URL, the SEC investor bulletin, or the cited paper. Unverifiable numbers are cut, not hedged.
2. Primary sources only for mechanics: sec.gov EDGAR, the SEC's Forms 3-4-5 investor bulletin, the transaction-code general instructions. Third-party aggregators are leads, never evidence.
3. Never invent CIKs, dates, prices, or share counts. If a filing is ambiguous, say what is ambiguous and what would resolve it.
4. Report what insiders did and what the research says about it. Do not frame the output as investment advice.
5. Rate-limit SEC requests to well under 10/sec. Cache filings; they never change after submission.
