Skip to content
Lokin
Paper trading
Sign in

TQQQ Dips with QQQ Trend

bymarc flores @floresmarc99v2

TrendStocks & ETFs

Buys TQQQ at the close after consecutive lower closes when QQQ is above its 200-day average, and exits at the close above TQQQ's 5-day average on QQQ, TQQQ

1 net votes (1 up, 0 down)
Backtest· v2
+315.8%
Jan 2020 – Oct 2026 · worst drop −20.0%
Growth of $100, Jan 2020 – Oct 2026. Simulated, with trading costs included.

The backtest result, the creator's paper run, and your own paper runs are separate sources and are never combined into one return.

About this agent

Trades QQQ, TQQQ with one rule: buys TQQQ at the close after consecutive lower closes when QQQ is above its 200-day average, and exits at the close above TQQQ's 5-day average.. Positions are checked every day, with equal money in up to 1 names. Over the test period from 2020 to 2026 it returned +316%, against +204% for the benchmark, with a worst drop of -20%. Simulated results with trading costs included; not a prediction.

The plan

Version 2 always runs exactly this plan. A change of any kind is published as a new version.

Buy rule
Buys TQQQ at the close after consecutive lower closes when QQQ is above its 200-day average, and exits at the close above TQQQ's 5-day average.
Show the exact rule

The calculation below is saved with this version and used when it runs.

Settings: down_days = 2, exit_days = 5, filter_days = 200 · uses 200 days of history

def signal(bars, params):
    if bars.phase != "close":
        return None
    t = bars.history["TQQQ"]
    q = bars.history["QQQ"]
    tc = t.close
    qc = q.close
    if len(tc) < params["down_days"] + 1 or len(qc) < params["filter_days"]:
        return None
    qma = q.indicator("sma", params["filter_days"])
    tma = t.indicator("sma", params["exit_days"])
    if qma is None or tma is None or qc[-1] is None or tc[-1] is None:
        return None
    held = bars.positions.get("TQQQ", 0) > 0
    if held and tc[-1] > tma:
        return {"TQQQ": 0}
    if not held:
        down = True
        for i in range(1, params["down_days"] + 1):
            if tc[-i] is None or tc[-i - 1] is None or tc[-i] >= tc[-i - 1]:
                down = False
        if down and qc[-1] > qma:
            return {"TQQQ": 1}
    return None
Stocks and ETFs
QQQ, TQQQ
Position sizes
Buying only · equal money in each · up to 1 at a time · at most 100% in one · checked every day
Orders and costs
Orders fill at the next day's open · costs 0.05% of each trade
Test period
Jan 1, 2020 to Oct 14, 2026 · compared with TQQQ

Backtest at a glance

Return
+315.8%
TQQQ, same period
+203.9%
Worst drop
-20.0%
Closed trades
105

See the full backtest result