Technical writing

SEC Form 4: The Insider Trading Disclosure Behind Every Officer and Director Stock Transaction

· AI Analytics
Federal DataSECInsider TradingSecurities

Every time a corporate officer, director, or ten-percent shareholder buys or sells stock in their own company, federal law requires a public disclosure within two business days. The disclosure vehicle is SEC Form 4, filed electronically on EDGAR and available to the world the moment the SEC accepts it. Three decades of academic research have confirmed that the open-market purchase subset of this data contains genuine informational content — one of the few corners of public regulatory data that demonstrably predicts future stock returns.

Section 16(a) and the Insider Disclosure Requirement

Section 16(a) of the Securities Exchange Act of 1934 requires officers, directors, and any person beneficially owning more than ten percent of a registered class of equity securities to file reports of their ownership and changes in ownership with the SEC. The requirement applies to public companies whose equity is registered under Section 12 of the Exchange Act — which covers essentially every company listed on a national exchange and many over-the-counter issuers above the registration threshold.

The rationale is disclosure of conflicts. Corporate insiders possess material non-public information by virtue of their positions: they know what earnings look like before the press release, what the board discussed about a merger target, what the FDA told management about a drug application. Mandatory real-time disclosure of their transactions does not prevent them from trading on this information — that is the province of Rule 10b-5 insider trading liability — but it creates a public record that allows regulators, journalists, and researchers to scrutinize the timing and pattern of their transactions against the subsequent release of material news.

The two-business-day deadline for Form 4 was imposed by the Sarbanes-Oxley Act of 2002, tightening the prior regime that allowed reports up to forty days after month-end. Electronic EDGAR filing became mandatory for Section 16 reporters in August 2004. Since then the Form 4 feed has been a near-real-time public window into insider transaction activity.

The Three Insider Ownership Forms

Section 16(a) creates three distinct reporting instruments, each covering a different stage of an insider's relationship with the issuer:

The three-form structure means that a comprehensive picture of an insider's position requires combining the Form 3 opening balance with all subsequent Form 4 changes and any Form 5 amendments. In practice, most analytical work begins with Form 4 and treats the post-transaction shares-owned field as a running position tracker without reconstructing the full Form 3 history.

Form 4 Data Fields

A Form 4 filing is structured in XML on EDGAR. Each filing covers one reporting person and one issuer, but may contain multiple individual transactions. The fields that matter for analysis:

Footnotes play an outsized role in Form 4 interpretation. Complex ownership structures, 10b5-1 plan notations, vesting schedules for RSU grants, and explanations of indirect ownership arrangements all appear in free-text footnotes attached to individual transactions. The footnote XML is unstructured and requires natural language processing or targeted pattern matching for systematic extraction.

Transaction Code Taxonomy

The transaction code field is the most analytically consequential field on Form 4. The SEC defines the following codes for non-derivative transactions:

The practical implication: filtering the raw Form 4 universe to code P alone eliminates roughly 90 percent of filings by count but preserves the only transactions where the insider exercised personal discretion and committed personal capital. RSU vesting events, option exercises, and compensation grants collectively dominate Form 4 volume but carry no discretionary signal. Every serious insider buying screen begins with the P-code filter.

The 10b5-1 Plan Problem

SEC Rule 10b5-1, adopted in 2000, created an affirmative defense against insider trading liability for trades made pursuant to a pre-established written trading plan. An insider who establishes a 10b5-1 plan while not in possession of material non-public information — specifying the amount, price, and timing of future transactions in advance — can execute those trades even if MNPI comes into the insider's possession afterward. The rationale is that the trading decision was made when the insider was clean; execution is mechanical.

The academic literature identified a structural flaw in the original rule. Research by Alan Jagolinzer (2009) in The Accounting Review and by Lauren Cohen, Christopher Malloy, and Lukasz Pomorski (2012) in the Journal of Finance documented that insiders were gaming 10b5-1 plans: entering plans shortly before expected positive news, exploiting the short mandatory cooling-off period that existed at the time, and executing trades immediately after. Insiders trading under 10b5-1 plans outperformed insiders trading outside plans by a statistically significant margin — the opposite of what the “pre-planned, non-informational” framing would predict.

The SEC addressed this in December 2022 with amendments to Rule 10b5-1 that took effect in 2023. The amended rule imposed a mandatory cooling-off period of 90 days (or the next quarterly earnings release date, whichever is later) for officers and directors between plan adoption and the first trade, capped single-trade plans in some circumstances, and required disclosure of 10b5-1 plan adoptions, modifications, and terminations on quarterly reports. For signal-building purposes, the 2023 amendments make 10b5-1 plan trades somewhat less contaminated but do not eliminate the issue entirely. The conservative analytical posture is to flag 10b5-1 plan transactions separately and weight them lower than non-plan purchases.

Identifying 10b5-1 plan transactions requires parsing the footnotes on each Form 4 filing. The filing does not include a structured field for this in the XML; instead, filers add a footnote to the transaction referencing the plan. Pattern matching on the footnote text — looking for phrases like “Rule 10b5-1 trading plan” or “adopted pursuant to” — identifies most plan transactions, but the lack of a structured field means any systematic approach will have false positives and negatives.

Accessing EDGAR Form 4 Data

All Form 4 filings are publicly available on EDGAR through several access paths:

The SEC's fair access policy requires automated requests to include a descriptive User-Agent header (name, organization, and contact email) and to limit request rates to no more than ten requests per second. Bulk download scripts that ignore rate limiting risk IP blocks that affect all users on a shared network.

The research community has also built secondary databases on top of EDGAR Form 4 data. OpenInsider at openinsider.com provides a filtered interface focused on open-market buys and sells, with filters by transaction size, insider type, company, sector, and date range. Quiver Quantitative provides programmatic API access to structured insider transaction data. Both services are derivative of the EDGAR primary source and update with a short lag after new filings are accepted.

Academic Research on Insider Buying as a Signal

The predictive content of insider transactions has been studied for more than four decades, beginning with work by Jeffrey Jaffe (1974) and H. Nejat Seyhun (1986). The consensus findings are stable across methodological approaches, sample periods, and markets:

Open-market purchases predict positive abnormal returns. Seyhun's 1992 study in the Journal of Business documented that aggregate insider buying across all public companies predicts broad market returns, with insiders collectively buying more before market upswings and selling more before downturns. At the individual stock level, insider purchases predict positive excess returns of roughly 3 to 6 percent over the six months following the transaction, with the effect strongest for small-cap companies where information asymmetry is greatest. Large-company insider purchases show smaller but still statistically significant effects, diluted by the depth of analyst coverage and the volume of other information production about the firm.

Open-market sales do not reliably predict negative returns. Lakonishok and Lee (2001) in the Review of Financial Studies established this asymmetry rigorously. After controlling for size, book-to-market, and momentum, insider sales carry no statistically significant predictive power for future returns. The contamination comes from the many non-informational reasons insiders sell: they sell to diversify concentrated positions, to fund real estate purchases, to make charitable gifts of appreciated stock, and to execute scheduled 10b5-1 programs. The subset of informed sales is swamped in the data by the uninformed majority.

Cluster buying is the strongest signal. Jeng, Metrick, and Zeckhauser (2003) in the Journal of Finance reported that insider purchases earn abnormal returns of approximately 6 percent over the following six months. More importantly, cluster buying — defined as purchases by three or more distinct insiders within the same company within a 30-day window — substantially amplifies the signal relative to single-insider purchases. Cohen, Malloy, and Pomorski (2012) further decomposed the insider universe into “routine” traders (insiders who buy or sell in the same calendar month year after year, suggesting mechanical behavior) and “opportunistic” traders (insiders with non-routine transaction timing). Opportunistic insider purchases predict 12-month abnormal returns of more than 8 percent, while routine purchases carry no significant predictive power. Separating the two categories requires at least three years of transaction history per insider to establish a baseline.

The Congressional parallel. The STOCK Act of 2012 created a Form 4 analog for members of Congress and senior congressional staff — the periodic transaction report. Research on congressional trading (Ziobrowski et al. 2004, 2011) found that senators and representatives also earned abnormal returns on their equity portfolios before the STOCK Act's enhanced disclosure requirements, a finding that contributed to the legislative push for the Act. The STOCK Act dataset provides a parallel insider-trading disclosure corpus for government insiders rather than corporate insiders.

Python: Screening EDGAR Form 4 for Open-Market Officer Purchases

The script below downloads the Form 4 quarterly bulk index for a given quarter, fetches the underlying XML for each filing, and extracts direct open-market purchases by officers above $100,000 in transaction value. The SEC's quarterly index files cover all quarters from 1993 onward; mandatory electronic Form 4 filing began in 2004, so pre-2004 filings are sparse. The approach scales to full historical coverage by looping across years and quarters.

import requests
import xml.etree.ElementTree as ET
import datetime

BASE_INDEX = "https://www.sec.gov/Archives/edgar/full-index"
BASE_ARCHIVE = "https://www.sec.gov/Archives"
HEADERS = {"User-Agent": "research@example.com"}

def get_form4_index(year, quarter):
    """Return all Form 4 entries from the quarterly full-text index."""
    url = BASE_INDEX + "/" + str(year) + "/QTR" + str(quarter) + "/form.idx"
    r = requests.get(url, headers=HEADERS, timeout=60)
    r.raise_for_status()
    rows = []
    for line in r.text.splitlines():
        if not line.startswith("4 "):
            continue
        form_type = line[0:12].strip()
        company   = line[12:74].strip()
        cik       = line[74:86].strip()
        filed     = line[86:98].strip()
        filename  = line[98:].strip()
        if form_type == "4":
            rows.append({"company": company, "cik": cik,
                         "filed": filed, "filename": filename})
    return rows

def parse_open_market(xml_text, min_shares=0):
    """Extract P-coded (open-market purchase) non-derivative transactions."""
    results = []
    try:
        root = ET.fromstring(xml_text)
    except ET.ParseError:
        return results

    issuer_name  = (root.findtext(".//issuerName")  or "").strip()
    issuer_cik   = (root.findtext(".//issuerCik")   or "").strip()
    filer_name   = (root.findtext(".//rptOwnerName") or "").strip()
    is_officer   = (root.findtext(".//isOfficer")   or "0").strip() == "1"
    is_director  = (root.findtext(".//isDirector")  or "0").strip() == "1"

    for txn in root.findall(".//nonDerivativeTransaction"):
        code = txn.findtext(".//transactionCode") or ""
        if code != "P":
            continue

        shares_text = txn.findtext(".//transactionShares/value") or "0"
        price_text  = txn.findtext(".//transactionPricePerShare/value") or "0"
        date_text   = txn.findtext(".//transactionDate/value") or ""
        direct_text = txn.findtext(".//directOrIndirectOwnership/value") or ""
        post_text   = txn.findtext(".//sharesOwnedFollowingTransaction/value") or "0"

        try:
            shares = float(shares_text)
            price  = float(price_text)
        except ValueError:
            continue

        if shares < min_shares:
            continue

        results.append({
            "issuer_cik":  issuer_cik,
            "issuer_name": issuer_name,
            "filer_name":  filer_name,
            "is_officer":  is_officer,
            "is_director": is_director,
            "txn_date":    date_text,
            "shares":      shares,
            "price":       price,
            "value_usd":   shares * price,
            "direct":      direct_text.strip() == "D",
            "post_shares": float(post_text) if post_text else 0.0,
        })
    return results

# Scan the most recent complete quarter for officer open-market purchases > $100k.
# Adjust year/quarter as needed; remove index_rows[:300] slice for full scan.
year, quarter = 2025, 1
index_rows = get_form4_index(year, quarter)
print("Form 4 filings in index: " + str(len(index_rows)))

purchases = []
for row in index_rows[:300]:
    url = BASE_ARCHIVE + "/" + row["filename"]
    try:
        xml = requests.get(url, headers=HEADERS, timeout=30).text
        hits = parse_open_market(xml, min_shares=0)
        for h in hits:
            h["date_filed"] = row["filed"]
            if h["value_usd"] >= 100_000 and h["is_officer"] and h["direct"]:
                purchases.append(h)
    except Exception:
        continue

purchases.sort(key=lambda x: x["value_usd"], reverse=True)
print("Officer open-market purchases >= $100k:")
for p in purchases[:10]:
    name   = p["filer_name"][:28].ljust(30)
    issuer = p["issuer_name"][:28].ljust(30)
    val    = str(int(round(p["value_usd"]))).rjust(12)
    print("  " + name + "  " + issuer + "  $" + val + "  " + p["txn_date"])

A few implementation notes. The quarterly index form.idx file is a fixed-width text file, not CSV, so substring slicing at defined column offsets is more reliable than split-based parsing. The XML document paths are relative to the EDGAR archive base URL; prepend https://www.sec.gov/Archives/ to each filename field. The script filters to direct ownership only: indirect purchases through trusts or LLCs reduce the signal quality because the economic commitment is less clear. For a cluster-buying screen, group the resulting purchase list by issuer CIK and transaction date, then count distinct filer CIKs within rolling 30-day windows.

Practical Applications

Investment signal generation. Quantitative equity strategies have used Form 4 open-market purchase data as a factor input since at least the early 2000s. The factor is typically constructed as a binary indicator (cluster buying occurred in the prior 30 days) or a continuous score (aggregate insider buying as a percentage of shares outstanding), then used in combination with valuation, momentum, and quality factors in a multi-factor model. Standalone reliance on insider buying as a trading signal requires careful handling of the illiquidity risk in small-cap stocks, where the signal is strongest.

Corporate governance monitoring. Institutional investors and proxy advisory firms track Form 4 data to assess alignment between executive incentives and shareholder interests. An executive who receives large equity grants (code A) but consistently sells (code S) through immediately-executed cashless exercises (code M same-day code S) is retaining little net equity exposure to the company's long-term performance. Form 4 data, integrated with the proxy statement's ownership tables, quantifies the degree to which executives are genuinely exposed to the stock price they are paid to maximize.

Investigative journalism. The two-day filing deadline makes Form 4 a near-real-time investigative source. Reporters monitor the EDGAR Form 4 feed for anomalous transactions — large sales in the days before a negative announcement, purchases immediately before an undisclosed acquisition, patterns of spring-loaded grants timed to precede positive news. Several SEC enforcement actions against insider trading originated as journalism, where a reporter noticed suspicious transaction timing in public Form 4 data, published a story, and the Commission opened an investigation.

M&A arbitrage intelligence. Ten-percent shareholders who are activist investors must file on Form 4 once they cross the reporting threshold, giving a transaction-level window into how the activist is managing its position through a campaign. Purchases after the initial 13D disclosure signal continued conviction; sales before a proxy contest vote can signal a settlement or exit. The Form 4 timestamp — accurate to the transaction date — makes it possible to reconstruct the activist's position changes week by week through the campaign.


Form 4 is one instrument in the EDGAR ecosystem. For financial statement data filed by the same companies whose insider transactions appear in Form 4 — 10-K annual reports, 10-Q quarterly reports, and the XBRL-tagged financials accessible via the EDGAR API — see SEC EDGAR Financials: Accessing Structured Financial Data from 10-K and 10-Q Filings.

Insider trading enforcement, including the criminal prosecutions and civil injunctions that Form 4 patterns have helped trigger, is documented in the DOJ Corporate Prosecution Registry. For the federal database of deferred prosecution agreements, non-prosecution agreements, and corporate guilty pleas that result from securities fraud investigations, see Corporate Prosecution Registry: DPAs, NPAs, and Federal Corporate Criminal Resolutions.

Public company financial reporting is subject to auditor oversight by the PCAOB, whose inspection reports and enforcement actions bear on the reliability of the financial statements that provide context for Form 4 transaction timing analysis. See PCAOB Audit Oversight: Inspection Reports, Deficiency Data, and Enforcement Actions.