Skip to content
All library documents

Using Public SEC Form 4 Filings for Insider-Based Portfolio Tilts

Article Lumibot

Summary

This example describes a watchlist strategy that uses public SEC Form 4 filings to adjust portfolio weights. A research agent retrieves recent filings and keeps open-market purchases and discretionary open-market sales, while excluding grants, gifts, option exercises, tax withholding, planned sales, and amendments. Separate agents debate bullish and bearish interpretations, assign weights, and pass them to a risk manager. The risk manager begins from equal weights, tilts toward buying activity, trims names with discretionary selling, and keeps a small cash allocation.

The example emphasizes point-in-time handling: filings become usable at SEC acceptance time, and backtests restrict available data to the simulated clock. This guards against using information that was not yet public. It includes no sample trades or performance results; activity is generated from filings read at run time. The approach is limited by its fixed watchlist, filtering choices, and lack of evidence about predictive value, transaction costs, or portfolio outcomes.

Key ideas

  • The strategy bases portfolio tilts on public Form 4 filings for a fixed watchlist.
  • It considers open-market purchases and discretionary sales while excluding several other filing types.
  • Separate research, debate, allocation, and risk roles contribute to the process.
  • Backtests limit filing access to information accepted by the simulated time.
  • The example provides no sample trades or performance results.

Tags

Full text
# agents example sec insider filings


SEC Form 4 Insider-Filing Agent
===============================

.. meta::
   :description: This example reads public SEC Form 4 filings for a fixed watchlist. It uses no material non-public information.

.. image:: ../docs/assets/ai-agent-workflows/ai-sec-insider-filings.png
   :alt: SEC Form 4 insider-filing AI trading team workflow
   :width: 100%

This example reads public SEC **Form 4** filings for a fixed watchlist. It uses
no material non-public information. A filing becomes visible at its SEC
acceptance time, never on the earlier transaction date.

How it works:

1. ``insider_trade_researcher`` calls ``get_filings(symbol, form='4')`` for each
   watchlist ticker. It opens recent filings with ``get_filing_document``. It
   keeps open-market purchases (code ``P``) and discretionary open-market
   sales (code ``S``). It ignores grants, gifts, option exercises, tax
   withholding, 10b5-1 plan sales, and amendments.
2. ``bull`` and ``bear`` argue for and against the tilts.
3. ``interpreter`` assigns weights across the watchlist.
4. ``trading_risk_manager`` starts from equal weight. It tilts toward names
   with insider buying and trims names with discretionary selling. It keeps
   cash near 0% to 5%. It is the only agent allowed to submit orders.

Point-in-time safety: in a backtest, the SEC tools cap every ``as_of`` at the
backtest clock. An agent cannot see a filing accepted after that moment, even
if it passes a later date.

This example does not ship sample trades. Every trade comes from real SEC
filings the agents read at run time.

Parameters:

- ``watchlist``: the tickers the strategy may hold.
- ``lookback_days``: how many days of filings the researcher reads.

.. literalinclude:: ../lumibot/example_strategies/ai_sec_insider_filings.py
   :language: python
   :linenos:

Shown in full with attribution under the source's licence. Licence: GPL-3.0

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.