import LogoutBar from "../components/LogoutBar.astro"; TrendTrooper — Auto-Switch Strategy
Home Dashboard Screener Analysis Strategy Academy Bot Status
⚙️ Auto-Switch System · Leveraged ETF Focus

The TrendTrooper
Auto-Switch Strategy

A systematic pipeline that reads TradingView signals, validates risk rules, and automatically rotates between leveraged ETFs based on momentum and trend conditions.

3x
Leveraged ETF focus
5m
Primary timeframe
ATR
Dynamic stop sizing
1%
Max risk per trade
THE PIPELINE

Signal to Execution — End to End

Every trade follows the same path. No manual intervention required.

STEP 01
📡

TradingView Alert

Pine Script strategy fires. Payload includes symbol, action, price, ATR, signal_id.

STEP 02
🔒

Cloudflare Gate

DNS + SSL + WAF. Webhook authenticated with shared secret. Replay protection via signal_id.

STEP 03

Risk Validator

Checks position size, daily loss limit, ATR stop distance. Rejects invalid signals with reason log.

STEP 04
🔁

Auto-Switch Logic

Determines bull vs bear ETF. Closes existing position, opens new bracket order.

STEP 05
🏮

Broker Execution

IBKR API. Entry + stop-loss + take-profit as bracket. Paper mode default.

SIGNAL LOGIC

Auto-Switch Conditions

The system rotates between SPXL and SPXS (or TQQQ/SQQQ) based on these conditions:

CONDITIONINDICATORSACTIONETF TARGET
Strong bullish trendEMA9 > EMA20 · Price > VWAP · RSI 50-70BUY BULLSPXL / TQQQ
Momentum confirmedMACD histogram positive · ATR expandingHOLD BULLSPXL / TQQQ
Trend weakeningEMA crossunder · RSI near 50 · MACD flatCLOSECASH
Bearish momentumEMA9 < EMA20 · Price < VWAP · RSI 30-50BUY BEARSPXS / SQQQ
Oversold extremeRSI < 30 · VIX spike · ATR elevatedWAITNO TRADE
PINE SCRIPT

Core Signal Logic

The TradingView strategy that generates the webhook payload. Runs on 5-minute bars.

strategy_core.pinePine Script v5
RISK RULES

Guardrails & Safety Controls

These rules run before every order. A single failed check cancels the trade and logs the reason.

Max 1% risk per tradeDollar risk = account x 1%. Position size = dollar risk / ATR stop distance.
Max 3% daily loss limitIf total daily P&L reaches -3%, all trading halts until next session open.
Signal authenticationEvery webhook validated against shared secret. Unsigned requests rejected instantly.
Replay protectionEach signal carries a unique signal_id. Duplicates within 60s window are dropped.
No trades outside market hours9:30 AM - 4:00 PM ET only. Pre/post market signals queued or discarded.
No trade if ATR too lowIf ATR is below minimum threshold, stop distance is too small — order rejected.
No pyramidingSystem is always flat or in one position. No adding to winners or losers.
Paper mode defaultAll new deployments start in paper trading. Live mode requires explicit opt-in.
PERFORMANCE

Simulated Equity Curve

Illustrative only — based on strategy logic applied to generated data. Not a guarantee of future results.

Portfolio Equity — Simulated 6 Month Run

● Strategy ● Buy & Hold SPX
Chart loading...
⚠️ Disclaimer: TrendTrooper is software tooling, not investment advice. All performance data shown is simulated and for illustrative purposes only. Trading leveraged ETFs involves substantial risk. Past simulated performance does not predict future results. Always test in paper mode first. You are solely responsible for your trading decisions.
INTEGRATION

Webhook Payload Format

Paste this into your TradingView alert message. TrendTrooper parses and validates each field.

Alert message (JSON)JSON

Webhook URL

Point your TradingView alert to your Cloudflare domain. Set method to POST, content-type to application/json.

Secret Key

Generate a strong random secret. Set it in both your TradingView alert and your TrendTrooper environment config.

Paper First

Always validate the full pipeline in paper mode before switching to live. Check logs after each test signal.