TQQQ Strategy AI Trading Bot

Research agent ranks TQQQ, SQQQ and other ETFs, bull and bear agents argue, judge and trader picks one side per index, then the trade order

This bot trades leveraged ETFs like TQQQ, which moves about 3 times the Nasdaq-100 each day, and SQQQ, which moves 3 times the opposite way. A bull agent and a bear agent debate the market, and a judge agent picks one side per index. Leveraged ETFs reset every day. ProShares warns that over any period longer than a day, your return “may be higher or lower” than 3 times the index (ProShares). That is why this bot rechecks the debate every day.

How it works

  1. Research agent ranks 12 leveraged ETFs, like TQQQ, SQQQ, UPRO, and SOXL, from recent prices and trends.

  2. Bull agent and bear agent read the same research and argue at the same time.

  3. Judge and trading agent weighs both sides and splits the account across the winners. It never holds an ETF and its opposite on the same index, like TQQQ with SQQQ, and sells the old side before it switches. The bot repeats this once a day.

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.

Backtest tear sheet

GPT-6 Luna, January 5 to 16, 2026, Yahoo daily prices, $100,000 start. The debate picked leveraged long ETFs (UPRO, UDOW, TNA, SOXL), never holding an ETF and its opposite together, and the bot ended at $103,475 (+3.5%) while SPY rose 1%. Cash never went below $22,809.

Backtest tear sheet for the TQQQ Strategy AI Trading Bot

Open the full tear sheet. A short backtest shows the bot works as written. It is not a promise of future returns.

The code

The whole bot is one short file. The prompts are plain English, and they are the strategy.

"""TQQQ Strategy AI Trading Bot.

A bull AI and a bear AI debate the market, then the bot picks leveraged ETFs like
TQQQ (3x the Nasdaq-100 up) or SQQQ (3x down). A research agent ranks the ETFs,
the bull and bear agents argue at the same time, and a judge agent trades,
holding only one side of each index.
"""

from lumibot.strategies import Strategy


class AITradingTeamBullBearLeveragedETFStrategy(Strategy):
    parameters = {
        "universe": ["TQQQ", "SQQQ", "UPRO", "SPXU", "UDOW", "SDOW", "TNA", "TZA", "SOXL", "SOXS", "TMF", "TMV"]
    }

    def initialize(self):
        self.sleeptime = "1D"
        self.agents.create(
            name="researcher",
            allow_trading=False,
            system_prompt=("Rank the ETFs in the universe from recent prices and trends. Do not trade."),
        )
        self.agents.create(
            name="bull",
            allow_trading=False,
            system_prompt=("Argue for the ETFs most likely to rise. Do not trade."),
        )
        self.agents.create(
            name="bear",
            allow_trading=False,
            system_prompt=("Argue the biggest risks in each ETF. Do not trade."),
        )
        self.agents.create(
            name="trader",
            allow_trading=True,
            system_prompt=(
                "You are the judge. Weigh the bull and bear cases and split the account across the winning "
                "ETFs. Never hold an ETF and its opposite on the same index, like TQQQ and SQQQ. Sell the old "
                "side before you switch."
            ),
        )

    def on_trading_iteration(self):
        facts = {"universe": self.parameters["universe"]}
        research = self.agents["researcher"].run(task_prompt="Rank the ETFs.", context=facts)
        facts = {**facts, "research": research.summary}
        debate = self.agents.run_together(
            [("bull", "Make the bull case.", facts), ("bear", "Make the bear case.", facts)]
        )
        self.agents["trader"].run(
            task_prompt="Judge the debate and rebalance.",
            context={**facts, "bull": debate["bull"].summary, "bear": debate["bear"].summary},
        )


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

    if IS_BACKTESTING:
        from lumibot.backtesting import YahooDataBacktesting

        AITradingTeamBullBearLeveragedETFStrategy.backtest(YahooDataBacktesting)
    else:
        AITradingTeamBullBearLeveragedETFStrategy().run_live()

Run it yourself

pip install lumibot
python -m lumibot.example_strategies.ai_trading_team_bull_bear_leveraged_etf

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). With IS_BACKTESTING=false the bot trades. With IS_BACKTESTING=true it backtests instead; 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

  • Leveraged ETFs can drop very fast and lose value when held through choppy markets. Paper trade first.

See AI Trading Bot Examples for more AI trading bots and Backtest, paper, or live: choose the runner for backtest and live runs.