Copying Congressional Stock Holdings from Public Disclosure Reports
Summary
The document describes an automated U.S. equities strategy that reconstructs a member of Congress’s reported stock portfolio from annual disclosures and subsequent transaction filings. A research agent combines the year-end holdings with later reported purchases and sales, while a portfolio agent converts reported dollar ranges into target weights using their midpoints. A trading agent then rebalances an account to those weights and checks order fills. It checks disclosures daily but trades only when a new report appears.
The source cites a reported 2024 return estimate for the copied portfolio and compares it with the S&P 500, but this is presented as an external report rather than a backtest of the described bot. Disclosures may arrive as late as 45 days after a trade, and annual holdings are also delayed, so copied positions can lag actual holdings. The article notes that filings must be filtered by filing date during historical tests to avoid look-ahead bias. It also flags the House website’s restrictions on commercial use of its reports.
Key ideas
- The strategy rebuilds reported holdings from annual disclosures and later transaction reports.
- Dollar value ranges are converted into portfolio weights using their midpoints.
- The bot checks filings daily but rebalances only after a new report appears.
- Disclosure delays mean copied holdings can differ from the member’s current portfolio.
- Historical tests must exclude reports filed after each simulated date to avoid look-ahead bias.
Tags
Full text
# agents example nancy pelosi trading bot Nancy Pelosi Stock Trading Bot ============================== .. meta:: :description: Estimate Nancy Pelosi's disclosed household stock portfolio with research and trading agents. Free Python code to backtest with LumiBot. .. image:: ../docs/assets/ai-agent-workflows/nancy-pelosi-stock-workflow.png :alt: Research agent works out what Pelosi owns from her House reports, trading agent makes your account match :width: 100% This bot estimates Nancy Pelosi's publicly disclosed household stock and listed-partnership portfolio, then scales that basket to your account. It reads official House reports to reconstruct the full inventory. Delayed disclosures and value ranges make this an approximation of her holdings. Want her call options too? The :doc:`agents_example_nancy_pelosi_copy_trading_bot` copies those as well. How it works ------------ The bot has just two AI agents, and both run every day: 1. **Research agent** reads the newest eligible annual snapshot and subsequent transactions on the `House Clerk website <https://disclosures-clerk.house.gov/>`__. It returns every included issuer's numeric asset-value range, snapshot date, eligible share changes and sources. Transactions after the snapshot date apply once, even if filed before the annual report. Full sales remove a holding; partial sales reduce it. 2. **Trading agent** estimates shares from each range midpoint and its snapshot-date price, applies later share changes and values the remaining inventory at current prices. It allocates 99% of account capital across the complete feasible basket. Current quotes size trades; small constituents remain part of replication. New disclosures trigger a full rebalance, including exits and additions. On quiet days established positions within 2 percentage points of target stay in place. There is no other code. Want a different member of Congress? Change the name in the research agent's prompt. Run it on BotSpot ----------------- Run this bot on `BotSpot <https://botspot.trade/marketplace?utm_source=documentation&utm_medium=docs&utm_campaign=lumibot_ai_examples&utm_content=agents_example_nancy_pelosi_trading_bot>`_ without installing anything. BotSpot runs LumiBot in the cloud, backtests it, and connects it to your broker. The code -------- The whole bot is one short file. The two prompts are the strategy. The research agent uses LumiBot's built-in web tools, which read ZIP files, PDFs, spreadsheets and web pages from any website. .. literalinclude:: ../lumibot/example_strategies/ai_nancy_pelosi_trading_bot.py :language: python Run it yourself --------------- .. code-block:: bash pip install lumibot ddgs==9.16.1 primp==2.0.1 python -m lumibot.example_strategies.ai_nancy_pelosi_trading_bot The two extra packages supply the existing keyless web-search tool. Direct document reads remain available; installing the search backend gives the researcher another way to find eligible original reports. The local example selects Luna High with API funding. Configure ``OPENAI_API_KEY`` and your broker keys (for example ``ALPACA_API_KEY``, ``ALPACA_API_SECRET`` and ``ALPACA_IS_PAPER=true``). For subscription funding, follow :doc:`agents_chatgpt` and select ``chatgpt/gpt-6-luna`` for both agents. Hosted BotSpot runs use BotSpot AI credits. With ``IS_BACKTESTING=false`` the bot trades. With ``IS_BACKTESTING=true`` it backtests; set ``BACKTESTING_START`` and ``BACKTESTING_END`` to choose the period, and ``BACKTESTING_BUDGET`` to choose starting cash. The default starting account is $100,000. For Polygon history, set ``BACKTESTING_DATA_SOURCE=polygon`` and configure your own ``POLYGON_API_KEY`` with access to the required dates. Both agents run every iteration, so a longer test makes more model calls. Good to know ------------ * Members of Congress can take up to 45 days to report a trade, so the bot always sees trades late. * Reports show dollar ranges, such as $1,000,001 to $5,000,000. Midpoints, snapshot prices and later disclosed changes produce estimated weights, not verified account balances. * The yearly report comes out in May and shows what she owned on December 31. Until the new one is filed, the bot starts from the year before and adds every trade since. * In a backtest the website also shows reports from after the test date. The research agent reads the date on each report and skips any report filed after the test day. * Whole-share rounding can leave cash or slightly overrepresent a small constituent. A missing price is a specific exception; the supported remainder still gets allocated. A source lookup failure does not mean an existing holding was sold. * Pelosi said on November 6, 2025 that she will not run for re-election in 2026 (`NBC News <https://www.nbcnews.com/politics/congress/nancy-pelosi-first-female-speaker-house-wont-seek-re-election-congress-rcna239324>`__). Her reports stop after she leaves office, so change the name in the research prompt to keep the bot trading. * The House website says its reports may not be used for most commercial purposes (5 U.S.C. 13107). Check that your use is allowed. See :doc:`agents_examples` for more AI trading bots and :doc:`strategy_run_modes` for backtest and live runs.
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.