← Library
Pine Script v6 · Strategy · TradingView V1 — AI Tech Momentum Breakout

AI-MOMO-V1

Momentum Breakout Strategy — AI Tech Equities · Multi-Layer Trend Filter · ATR-Based Risk Management

File: ai_tech_momentum_breakout.pine Type: strategy() — backtestable Capital: $25,000 initial Direction: Long & Short Market: AI Tech Equities Created: May 20, 2026

Overview

AI-MOMO-V1 is a momentum breakout strategy designed for high-volatility AI technology equities (NVDA, AMD, MSFT, META, GOOGL, AMZN). It uses a four-layer entry filter to ensure all signals are aligned across macro trend, short-term trend, momentum, and breakout confirmation before entering a position.

Rather than mean reversion or fixed-time entries, AI-MOMO captures explosive directional moves that AI tech names are known for — riding the surge with ATR-based trailing stops to lock in gains while avoiding premature exits.

MACRO
200 EMA Filter
Long-term bias
TREND
21/50 EMA Cross
Short-term direction
MOMENTUM
RSI 55–78
Strength confirmation
BREAKOUT
N-bar High/Low
+ Volume surge

Entry Logic — Four-Layer Filter

All four conditions must be true simultaneously for a signal to fire. This eliminates false breakouts in choppy or ranging markets.

Long Entry

Price >
200 EMA
+
EMA 21 >
EMA 50
+
RSI
55–78
+
Break above
N-bar High + Vol
BUY
Long

Short Entry

Price <
200 EMA
+
EMA 21 <
EMA 50
+
RSI
22–45
+
Break below
N-bar Low + Vol
SELL
Short
One Position at a Time Entries are only placed when strategy.position_size == 0. The strategy will not add to an existing position or flip without first being flat.

Risk Management — ATR-Based

All stop loss, take profit, and trailing stop distances are calculated as multiples of the Average True Range (ATR). This automatically scales risk to the instrument's current volatility — tighter stops on calm days, wider stops during earnings/news events.

ParameterDefaultDescription
ATR Length14Lookback period for ATR calculation
Stop Loss1.5× ATRDistance below/above entry before position is closed at a loss
Take Profit3.0× ATRDistance to fixed profit target — 2:1 minimum R:R
Trailing Stop2.0× ATRLocks in gains on runners — activates after entry, trails price
Use Trailing StoptrueToggle trailing stop on/off. When off, only fixed TP/SL applies.
Why ATR over Fixed Ticks AI tech stocks like NVDA can move $5 intraday on a quiet day and $40 on earnings. A fixed 50-tick stop would be blown through constantly. ATR multipliers adapt automatically — this is the correct approach for volatile, high-beta names.
Trailing Stop Note The trailing stop uses trail_points in ticks calculated as atr × trail_mult / syminfo.mintick. Verify your chart's tick size is correct before live use — an incorrect mintick will produce a wrong trailing distance.

All Configurable Inputs

GroupParameterDefaultNotes
Trend FilterFast EMA21Short-term trend EMA
Trend FilterSlow EMA50Medium-term trend EMA
Trend FilterMacro EMA200Long-term trend bias filter — only long above, only short below
MomentumRSI Length14Standard RSI lookback
MomentumRSI Entry Threshold (Bull)55Minimum RSI for long entry. Bear entry threshold = 100 - this value (45)
BreakoutBreakout Lookback20Number of bars to look back for the prior high/low breakout level
BreakoutVolume Multiplier1.5×Current bar volume must exceed avg × this multiplier to confirm breakout
BreakoutVolume Avg Length20SMA length for the volume average baseline
Risk ManagementATR Length14ATR calculation lookback
Risk ManagementStop Loss (ATR x)1.5SL distance as ATR multiple
Risk ManagementTake Profit (ATR x)3.0TP distance as ATR multiple — 2:1 R:R at defaults
Risk ManagementUse Trailing StoptrueEnables ATR trailing stop on open positions
Risk ManagementTrail Stop (ATR x)2.0Trailing stop distance as ATR multiple
TestingForce Manual TriggerfalseFires a test webhook payload — use with "Once Per Bar" alert setting

Chart Visuals

ElementStyleDescription
EMA Fast (21)Aqua lineShort-term trend direction
EMA Slow (50)Yellow lineMedium-term trend direction
EMA Macro (200)Gray line (semi-transparent)Long-term macro bias — bullish above, bearish below
Prior HighGreen step-lineN-bar lookback high (breakout trigger level)
Prior LowRed step-lineN-bar lookback low (breakdown trigger level)
Long Entry markerGreen triangle (below bar)Fires on confirmed long breakout signal
Short Entry markerRed triangle (above bar)Fires on confirmed short breakdown signal
Background tintGreen / Red (5% opacity)Macro bias — green when price > 200 EMA, red when below

Alert Messages — JSON Payload

AI-MOMO-V1 sends separate payloads for long and short entries via alert_message on strategy.entry() and standalone alertcondition() triggers.

Long Entry (BUY)

{ "secret": "tac_com_alpha_9", "model_id": "AI-MOMO-V1", "ticker": "NVDA", "action": "BUY", "price": 1042.50, "metadata": { "tier": "MOMENTUM_BREAKOUT", "rsi": 62.4, "atr": 18.7500, "note": "Long breakout confirmed", "timestamp": 1747789200000 } }

Short Entry (SELL)

{ "secret": "tac_com_alpha_9", "model_id": "AI-MOMO-V1", "ticker": "NVDA", "action": "SELL", "price": 1042.50, "metadata": { "tier": "MOMENTUM_BREAKOUT", "rsi": 38.1, "atr": 18.7500, "note": "Short breakout confirmed", "timestamp": 1747789200000 } }
FieldDescription
secretShared webhook authentication key for NIGHTHAWK
model_idRoutes the signal to the AI-MOMO-V1 handler in Sentinel
tickerSymbol the alert fired on — dynamic via syminfo.tickerid
actionBUY or SELL
priceClose price at time of signal
metadata.tierStrategy classification — MOMENTUM_BREAKOUT
metadata.rsiRSI value at signal bar — useful for downstream filtering
metadata.atrATR value at signal bar — used to reconstruct SL/TP levels
metadata.timestampUnix timestamp in milliseconds via timenow

Manual Test Trigger

{ "secret": "tac_com_alpha_9", "model_id": "AI-MOMO-V1", "action": "TEST", "metadata": { "note": "MANUAL_TRIGGER", "timestamp": 1747789200000 } }

Toggle FORCE MANUAL TRIGGER in the Testing input group and set the alert to "Once Per Bar" to fire the test payload to your webhook endpoint.

Sentinel DB Registration

FieldValue
model_idAI-MOMO-V1
statusOBSERVATION
Migrationv1.4 — 2026-05-20
OBSERVATION Status The model is registered in Sentinel but not yet routing live orders. Backtest on TradingView Strategy Tester and paper trade via the manual trigger before promoting to LIVE.

Recommended Tickers & Timeframes

TickerNameRecommended TFNotes
NVDANVIDIADaily / 4HHighest volatility AI name — adjust ATR multipliers up slightly
AMDAdvanced Micro DevicesDaily / 4HStrong momentum mover, good breakout follow-through
MSFTMicrosoftDailyLower volatility — tighter ATR, reliable trend signals
METAMeta PlatformsDaily / 4HHigh beta, responds well to momentum signals
GOOGLAlphabetDailyTrend-following works well, lower noise than NVDA/AMD
AMZNAmazonDailyAWS/AI exposure — breakout follow-through historically strong
Timeframe Recommendation Daily timeframe produces the cleanest signals with the lowest noise. 4H can be used for more frequent entries but expect more false breakouts — consider increasing the volume multiplier to 2.0× on 4H.

TradingView Setup

  1. Open a Daily or 4H chart on your target ticker (start with NVDA for initial backtest).
  2. Open Pine Editor (Alt+P), clear existing code, paste ai_tech_momentum_breakout.pine, click Add to chart.
  3. Open the Strategy Tester tab. Review win rate, max drawdown, and Sharpe ratio before adjusting parameters.
  4. Tune atr_sl_mult and break_len per ticker — NVDA may need wider stops (2.0×), MSFT can use tighter (1.2×).
  5. To activate live alerts: hover over indicator → ···Add alert on AI-MOMO.
  6. Set the alert to fire on Order fills or use the AI-MOMO Long/Short Entry alertcondition entries.
  7. Set Webhook URL to your NIGHTHAWK endpoint to route signals to Sentinel.
  8. Use Force Manual Trigger with "Once Per Bar" to test the webhook pipeline before enabling live signals.