Historical strategy research · October 11, 2026

Leveraged ETF trading bot: create, backtest and deploy TQQQ rules

Build a TQQQ bot from a QQQ trend signal. Inspect the 62.91% development return, full-exit and dividend repairs, matched baselines and losing reserved test.

As of 2026-10-11

Development strategy
62.91%
TQQQ development
-2.18%
Reserved-test strategy
-10.81%
TQQQ reserved test
3.50%

Create a leveraged ETF trading bot with an honest TQQQ baseline

Leveraged ETFs, often shortened to LETFs, make a simple market-timing rule consequential. This guide uses a QQQ trend signal to decide when a bot holds TQQQ and when it holds cash. It follows the strategy through three initial variants, two accounting repairs, a complete event audit and a frozen later test.

The corrected TQQQ bot returned 62.91% during 2022–2024 versus holding TQQQ's -2.18% and holding QQQ's 30.72%. In the reserved July–September 2026 test, the same bot returned -10.81% versus TQQQ's 3.50%. Both comparisons belong in the same article.

What a leveraged ETF promises each day

ProShares UltraPro QQQ, ticker TQQQ, seeks three times the Nasdaq-100's daily performance before fees and expenses. Its objective resets daily. It does not promise three times the index's cumulative return across an arbitrary holding period. ProShares' TQQQ fund page

Consider an index that rises 10% and then falls 10%. Starting at 100, it ends at 99, down 1%. An idealized fund delivering three times each daily move would go from 100 to 130 and then to 91, down 9%, before costs and tracking differences. Three times the index's two-day loss would be only 3%. The order and compounding of daily moves matter.

Trending moves can compound leveraged gains, while repeated reversals can compound losses. A slower trend filter can also exit late or miss a sharp recovery. Use actual fund prices to test these trade-offs. Multiplying QQQ's multi-year return by three cannot recreate TQQQ's realized price path, fees or distribution behavior.

This study buys actual TQQQ shares without adding account-level margin borrowing. The fund already provides leveraged exposure through its own structure. Putting 95% of the portfolio into TQQQ is therefore a large risk allocation even though the bot does not borrow at the brokerage. A dollar allocation and an exposure allocation are different quantities.

The tested TQQQ and QQQ strategy

Use QQQ as the signal asset and TQQQ as the traded asset. When QQQ is above its 50-calendar-day native rolling mean and no TQQQ is held, buy TQQQ with 95% of available buying power. When QQQ is at or below that mean and a position exists, sell the entire held TQQQ quantity. The portfolio holds cash between positions. It never buys an inverse fund or shorts QQQ.

The mean uses timestamped prices within a calendar window, rather than exactly 50 closing bars. The other variants use 100- and 200-calendar-day windows with the same sizing and signal relationship. Evaluate on the native Day observation contract. This is a trend-and-cash strategy, not an intraday scalping system or an automatic rebalance to fixed three-times exposure.

The selected version uses fractional shares, $10,000 starting capital, cash dividends and a 0.05% fee on submitted notional for each fill. Cash receives no credited interest. Actual TQQQ observations supply the strategy price path. TQQQ buy and hold is the primary baseline; QQQ buy and hold shows the alternative of owning the unleveraged fund. Both benchmarks use the native dividend-adjusted comparison path and identical timestamps.

Scroll sideways to compare all columns. Select a heading to sort.

Signal / traded assetQQQ / TQQQ
RegimeQQQ above its 50-calendar-day mean: TQQQ; otherwise cash
Position size95% of buying power; fractional shares
Trading fee5 basis points (0.05%) of submitted notional per fill
DistributionsStrategy receives dividends as cash
ComparisonsActual TQQQ and QQQ holding paths, on matched timestamps

Compare the variants before choosing a winner

Compare 50-, 100- and 200-calendar-day QQQ trend windows. Inspect the leading original, correct its fee-sized exits, then test cash dividends after finding a reinvestment residual. Rerun all three settings under each declared revision. Among the coherent full-exit/cash-dividend versions, the 50-day window has the highest net development return. The higher original result remains identified as the version with unintended residual holdings.

Scroll sideways to compare all columns. Select a heading to sort.

Original 50-day / reinvest68.51%52.92%63
Original 100-day / reinvest-31.52%59.88%42
Original 200-day / reinvest62.93%50.53%28
Full-exit 50-day / reinvest63.09%45.68%40
Full-exit 100-day / reinvest1.79%60.53%27
Full-exit 200-day / reinvest45.31%55.88%17
Full-exit 50-day / cash dividends62.91%45.68%40
Full-exit 100-day / cash dividends1.71%60.53%27
Full-exit 200-day / cash dividends45.27%55.88%17

2022–2024 development results. Returns include declared costs. The native closed-trade count measures asset trades or option legs: a two-leg spread contributes two closed legs. Selection used net return, with drawdown reported separately.

The backtest that beat the baseline

The selected version ended at $16,290.60 from $10,000, a 62.91% cumulative return. The matched TQQQ holding ended at $9,782.19, or -2.18%. The strategy's maximum drawdown was 45.68%; the benchmark's drawdown at the same recorded observations was 81.19%.

The actual TQQQ holding ended at $9,782.19, while actual QQQ holding ended at $13,072.21, a 30.72% gain. Strategy distributions go to cash; holding baselines use native dividend-adjusted comparison paths. The baseline paths do not pay the repeated strategy order fees. This is a comparison with real fund observations, not a synthetic three-times-QQQ series.

The chart follows the recorded observation path, including losses between the endpoints. The reader groups observations for display, while the download retains every original value. Initial capital is $10,000 before the first order; the first strategy point may already include a fee. The benchmark begins at $10,000 on the same first timestamp.

Development: 2022-01-03 through 2024-12-31, $10,000 starting capital20.1K1.93K2022-01-032024-12-31
Strategy, costs includedTQQQ buy and holdQQQ buy and holdHistorical simulation

Two small balances changed the trading behavior

The first 50-day replay returned 68.51%, but a nominal 100% sell left a small share balance after the allocator deducted fees before sizing. Since a new buy required a zero position, that remainder changed subsequent entries. A better-looking result produced by the wrong position behavior was not the result chosen for the article.

At the declared 0.05% fee, the research workaround requests 100.1% in that allocator and relies on the engine's cap at the actual held quantity. The observed corrected sells clear the held shares. The intended portable rule is simply to sell the full position; verify live sizing instead of transplanting this percentage into an unrelated platform.

The reinvested-dividend replay revealed another balance. On December 31, 2024, the portfolio sold its TQQQ position while a dividend payment also reinvested 1.366604 shares at the same observation. The $54.07 position left behind could obstruct the exact-zero entry guard. Paying distributions to cash avoids that extra share issuance while preserving the earned dividend in portfolio value.

The full-exit/reinvestment version returned 63.09%; the full-exit/cash-dividend version returned 62.91%. The small change in the final number hid a meaningful change in holdings behavior. All three window settings were rerun with the same cash-dividend policy before choosing the corrected 50-day version.

The selected development replay contains 80 filled orders and 40 exits that cleared the position. Reconstructed fees total $413.17, and recorded cash dividends total $355.38. Cash reconciles with the native ending value to less than one cent, with zero final TQQQ shares and no negative quantities.

Read the signal, the order and the remaining position together

The December 31, 2024 exit signal recorded QQQ at $511.23 against its rolling mean of $516.78. QQQ was below the threshold and the TQQQ position value was positive. The simulated sale cleared all 389.577257 held TQQQ shares; the corresponding morning buy and evening sale show why both evaluations must appear in a trade audit.

Six sampled signal events had the expected condition values. The full filled-order tape and dividend cash flows were reconciled, but every signal heartbeat was not independently reviewed. The native daily stock fills occur at the recorded observation price with no delay in this model. That assumption does not establish the spread, impact or live latency of a market order sent to a brokerage.

When reviewing a similar LETF bot, inspect the worst drawdown, the first entry after a full exit and every distribution near an exit. Verify that the bot is flat when the rule says cash and that a split or distribution has not silently changed the share balance. Check the actual fund path and the unleveraged comparison before attributing a gain to timing skill.

Freeze the rules, then test later dates

The initial rules and repairs used January 2022 through December 2024. A January 2025 through June 2026 follow-up tested the selected version unchanged. Those follow-up dates were already present in prior research, so they remain development evidence. They were not used to pick a more favorable setting for this article.

The final rules were saved before requesting July 5 through September 30, 2026. That reserved period had not been inspected in this study. It is a historical holdout within this procedure; we cannot certify that every prior researcher had never viewed it. All published results are historical simulations. Each window starts a separate $10,000 portfolio from cash and warms its indicators with earlier observations. This is a fixed-rule chronological test, rather than an adaptive optimizer that chooses new rules every quarter.

In the reserved test the bot returned −10.81%, TQQQ holding returned 3.50% and QQQ holding returned 2.76%. Its maximum drawdown was 18.64%, compared with the matched benchmark drawdowns in the download. Six completed round trips lost money and one position remained open. The longer follow-up and this short reserved test show that the development return lead did not persist on the fixed rules.

Once the reserved result was returned, the rules stayed frozen. Repeatedly changing an entry until it wins on that same period would turn the period into training data. Further research should document a new hypothesis, use development dates for revisions and reserve another genuinely unseen period or prospective paper observation. Losing months are allowed; a claim about beating buy and hold must still be supported across the declared evaluation period.

Scroll sideways to compare all columns. Select a heading to sort.

2022–2024 development62.91%-2.18%45.68%
2025–June 2026 follow-up64.89%103.66%33.79%
July–September 2026 reserved test-10.81%3.50%18.64%

Independent $10,000 starts. These returns must not be described as one continuously held account or averaged into an annual return.

Reserved historical test: 2026-07-06 through 2026-09-30, $10,000 starting capital10.7K7.64K2026-07-062026-09-30
Strategy, costs includedTQQQ buy and holdQQQ buy and holdHistorical simulation

Why the baseline and drawdown both matter

The development result beats holding TQQQ and holding QQQ, with a 45.68% strategy maximum drawdown. That is a large loss from a prior account peak. The cash regime reduced some sustained downside exposure, but the chosen filter still endured painful reversals. A 62.91% endpoint gain cannot substitute for the complete path.

During the 2025–June 2026 follow-up, the bot gained 64.89% while holding TQQQ gained 103.66%. In the reserved test, six round trips lost money and a seventh entry remained open at the endpoint. The same timing rule that looked strong across 2022–2024 gave up gains or paid for whipsaws in later windows.

TQQQ's fund expenses and realized tracking behavior are reflected in its actual traded-price path; the strategy's order fees are applied separately. This simulation does not add a second invented fund expense charge, account-level financing cost or return on idle cash. Changing any of those assumptions requires a clearly labeled new comparison.

Create this leveraged ETF trading bot in NexusTrade

Open Aurora with the filled-in request below. Read the proposed entries, exits, allocation and asset types, then create a saved research draft. Inspect the saved rules before submitting a backtest. Natural-language requests help express the idea; the executable rules determine what the engine actually does.

Keep QQQ as the price-signal asset and TQQQ as the order asset. Ask Aurora to verify the zero-position guard, complete-exit sizing and cash-dividend policy. Request both TQQQ and QQQ comparisons with identical endpoints and the same strategy contract. Do not replace the actual TQQQ tape with three times a QQQ return.

For a new investigation, write down the candidate settings, benchmark, fees, dates and selection criterion first. Start with a small declared set of variants. Run them on the development period, inspect the leading candidate's signals and filled orders, fix a demonstrated accounting or execution issue, and rerun the affected candidates. Keep both the original and corrected results. Freeze the chosen rules before requesting the reserved period.

Paper-test and deploy this leveraged ETF trading bot

After reviewing the rules and historical tests, prepare a separate paper portfolio from the saved draft. Record its new simulated identity and keep a dated log of signals, order status, quantities, fees and holdings. An accepted order and a filled order are different events. Check why an expected order did not fill and whether every intended exit actually cleared the position.

The simulation uses fractional TQQQ shares. Use an adapter and account that permit fractional shares, or create and test a whole-share version first. Check leveraged-ETF eligibility and order restrictions in the intended brokerage. Fund-level leverage remains present even with a cash-only account, so review exposure as well as the dollar allocation.

Choose evaluation timing explicitly. These studies used Day observations, not a continuous minute tape. A faster live schedule changes the strategy's opportunities and must be tested separately. Monitor pending orders and available cash so overlapping evaluations cannot create duplicate exposure. Compare paper observations with the expected conditions at the same timestamps; save every revision as a new version.

For live deployment, connect the intended brokerage through NexusTrade's account controls, verify the imported account, confirm instrument permissions and inspect the rules in the live portfolio. Review Port to Live and the automated-trading controls yourself. Start with an allocation you have explicitly chosen and watch the first entry and exit. A historical chart does not verify the live account's permissions, spreads, fill latency or borrowing terms.

Use the development win to ask a better research question

The corrected 50-day bot beats both holding comparisons across its development window. The later tests measure where the fixed filter falls behind. The appropriate next question is which market behavior causes the missed recovery or repeated entries, and whether a declared modification survives a fresh test after its rules are frozen.

Use the exact draft in Aurora and keep the TQQQ and QQQ benchmarks visible. Retain the losing settings and original accounting issue with your notes. Before a separate deployment decision, observe the paper portfolio's entries, complete exits and dividend treatment under the schedule you actually intend to run.

Continue exploring

Discussion

Sign in or create a free account to join the discussion.

No comments yet.

Aurora · AI research assistant

Try this in Aurora

Edit the request, then open it in Aurora. You choose when to send it.