Nancy Pelosi Copy Trading Bot

Research agent works out Pelosi's stocks and call options, trading agent sizes them to your account and buys them

Most Pelosi copy bots only buy her stocks. But much of her trading is call options: in her January 23, 2026 report alone she bought call options on Alphabet, Amazon, Apple and Nvidia that expire in January 2027 (House Clerk report). This bot copies those too: it holds her stocks, plus calls on the same stocks with the same expiration dates, sized to your account.

Only want her stocks? Use the Nancy Pelosi Stock Trading Bot.

How it works

The bot has just two AI agents, and both run every day:

  1. Research agent reads Pelosi’s official financial disclosure reports on the House Clerk website (disclosures-clerk.house.gov): her newest yearly report plus every trade report filed since. It works out every stock and every call option she owns today, with the number of contracts, strike price and expiration date. It skips options that have already expired.

  2. Trading agent sizes everything to your account and trades it. By default 20% goes to her calls and the rest to her stocks, in her proportions. Her calls cost $9,000 to $18,000 a contract, more than a normal account can spread around, so it uses her exact strike when one contract fits and otherwise the nearest strike that fits, with the same expiration date. It leaves a holding alone when it is within 2 percentage points of its target.

Want a different member of Congress? Change the name in the research agent’s prompt.

Run it on BotSpot

Run this bot on BotSpot 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.

"""Nancy Pelosi Copy Trading Bot.

Copies Nancy Pelosi's stocks and her call options (same stock, same expiration),
sized to your account. Every day a research agent works out what she owns today
from her public financial disclosure reports, and a trading agent makes the
account match. "options_share" sets the share of the account in calls.
"""

from lumibot.strategies import Strategy


class NancyPelosiCopyTradingBot(Strategy):
    parameters = {"options_share": 0.2}

    def initialize(self):
        self.sleeptime = "1D"
        self.agents.create(
            name="researcher",
            allow_trading=False,
            allow_network=True,
            system_prompt=(
                "Find out which stocks and call options Nancy Pelosi owns today and how much of each. Use her "
                "official financial disclosure reports on the U.S. House Clerk website "
                "(https://disclosures-clerk.house.gov): her newest yearly report of everything she owns, plus every "
                "trade report filed after it. Use only reports filed before today. If your last answer is given, "
                "start from it and only read reports filed since then. Skip expired options, funds, bonds, real "
                "estate and private companies. Give each stock's ticker and dollar range, and each call "
                "option's stock, strike price, expiration date, number of contracts and dollar range. Do not trade."
            ),
        )
        self.agents.create(
            name="trader",
            allow_trading=True,
            system_prompt=(
                "Make the account copy the research. Put options_share of the account into her call options and the "
                "rest into her stocks, each in proportion to the middle of its dollar range. Use the same stock and "
                "expiration as each of her calls, her strike if one contract fits that call's money, otherwise the "
                "nearest higher strike that fits. Sell holdings that are not in the research and buy the ones you do "
                "not own. Leave a holding alone when it is within 2 percentage points of its target. Sell before you "
                "buy, never short, and never spend more cash than you have."
            ),
        )

    def on_trading_iteration(self):
        # The researcher gets its last answer back, so it only needs to read reports filed since then.
        research = self.agents["researcher"].run(
            task_prompt="What does Nancy Pelosi own today?",
            context={"your_last_answer": self.vars.get("last_research", "none yet")},
        )
        self.vars.set("last_research", research.summary)
        self.agents["trader"].run(
            task_prompt="Match the account to the research.",
            context={"research": research.summary, "options_share": self.parameters["options_share"]},
        )


if __name__ == "__main__":
    from lumibot.credentials import IS_BACKTESTING

    if IS_BACKTESTING:
        from lumibot.backtesting import AlpacaBacktesting

        NancyPelosiCopyTradingBot.backtest(AlpacaBacktesting)
    else:
        NancyPelosiCopyTradingBot().run_live()

Run it yourself

pip install lumibot
python -m lumibot.example_strategies.ai_nancy_pelosi_copy_trading_bot

Put these in your .env file: OPENAI_API_KEY, and your broker keys (for example ALPACA_API_KEY, ALPACA_API_SECRET, and ALPACA_IS_PAPER=true for paper trading). Your broker account needs options trading turned on. With IS_BACKTESTING=false the bot trades. With IS_BACKTESTING=true it backtests on Alpaca’s price history instead, which has options from February 2024; set BACKTESTING_START and BACKTESTING_END to pick the dates, and start with a week or two, because every AI call costs a little.

Good to know

  • Change options_share to put more or less of your account into calls. Set it to 0 to copy only her stocks.

  • A cheaper strike is a bigger bet on the stock going up than her strike: it is cheaper because it pays off only above a higher price.

  • Call options can lose all their value by the expiration date.

  • Members of Congress can take up to 45 days to report a trade, so the bot always buys late, often at a different price than she paid.

  • Reports show dollar ranges, such as $1,000,001 to $5,000,000. The bot uses the middle of each range.

  • 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.

  • Pelosi said on November 6, 2025 that she will not run for re-election in 2026 (NBC News). 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 AI Trading Bot Examples for more AI trading bots and Backtest, paper, or live: choose the runner for backtest and live runs.