Nasdaq Surge Detector
A rule-based intraday strategy for the Nasdaq-100. It uses a CUSUM (cumulative sum) detector to spot moves that are large compared with the session's own recent volatility, and trades in the direction of the move during regular hours.
- Market
- the Nasdaq-100, under any of the names it trades as.
- Runs on
- any of those symbols, 3-minute chart (recommended).
Free on request during the launch period.
Open on TradingViewThe rules, in full
- Threshold: from 18:00 ET the script builds 15-minute bars. Once 21 have closed (about 23:15 ET), h = 2.0 x the standard deviation of the last 20 fifteen-minute log returns of the session. It resets each session.
- Detector: an up-sum tracks the rise in log price since the lowest point since its last reset; when it goes above h, that is an up event and it resets. A down-sum does the same for falls.
- Chart timeframe: the threshold always uses 15-minute buckets from 18:00 ET whatever the chart is, but the detector is checked at each chart bar's close, so a 3-minute chart tests the move five times more often than a 15-minute chart and a different chart timeframe produces a different set of events and trades.
- Entry: an up event buys and a down event sells, at market on the next bar's open, only if the signal is between 09:30:00 and 15:59:55 ET and at least 60 minutes and 5 seconds have passed since the previous signal (either side; skipped signals also restart the wait).
- No hedging: a signal opposite to an open position is skipped. Same-side signals can stack, each a separate 1-contract position with its own stop and target, so open risk is a multiple of the single-trade stop. The pyramiding setting allows 10; the 60-minute spacing inside 09:30-15:59:55 ET allows at most 7 in one session, and every position is flat by 16:09 ET, so a stack never carries into the next session.
- Stop: a wide stop at 2.0 x U on the bar after the fill, then 0.35 x U from the entry from about 6 minutes after the entry bar opened. U = median high-low range of the previous 20 daily bars of that symbol (18:00-17:00 ET on futures). Stop and target start working on the bar after the fill bar, so the fill bar itself carries no stop order. Each stacked position runs its own wide stop during its own grace window.
- Target: Initial Balance (IB) = 09:30-10:30 ET range. Long target = IB high + 0.5 x IB range; short target = IB low - 0.5 x IB range. Used only if the signal comes after the Initial Balance is complete (the first eligible entry is about 10:33 ET on a 3-minute chart) and the level is beyond the entry; otherwise there is no target.
- Time exit: all positions are closed at market at 16:09 ET (input). Positions are also closed if a new session starts.
- All of these are wall-clock ET times on every symbol: on a broker whose CFD day runs on another clock the windows land at a different local hour, and you would have to choose and test your own.
That is the whole rule set, exactly as published. Nothing is held back for subscribers.
What you see on the chart
- Green LONG label below the signal bar or red SHORT label above it (price, stop and target in the tooltip).
- "EXIT +/- pts" label; the reason (Stop, Target: IB ext, the 16:09 ET time exit, Session change) is in its tooltip.
- Faded dots for events that did not become trades.
- In a trade: white entry, red stop and green target lines, with risk and target zones.
- IB high/low lines and both IB target levels.
- Each level line is named with its price at its right end (Entry, Stop, Target, IB high, IB low, IB long/short target).
- Compact status box (top right by default): the symbol and how it was read (Nasdaq futures / Nasdaq index / CFD / Nasdaq ETF); the state (WAITING, ARMED, IN LONG / IN SHORT with stop, Done for today, or OFF on a non-Nasdaq symbol or wrong timeframe); IB targets; stop size / flat time / signal count; one short yellow note when needed; and an orange reminder on CFD and ETF symbols about Properties and the chart session. Hover a row for details; turn on "Show details" for IB high/low, threshold, move meters, U and more.
- Red banner mid-chart on any symbol that is not Nasdaq-100 (no orders) or on a timeframe that cannot run the rule (above 15 minutes or not dividing 15); seconds charts are not rejected but need far more bars than any plan loads. On any chart other than 3 minutes the status box shows a tip row recommending the 3-minute chart. The no-signal tooltip is about loaded history only: it reports the days loaded, the sessions needed and the bars that takes on your chart.
Alerts
1. Add the strategy to a Nasdaq-100 3-minute chart - NQ1!, MNQ1!, NAS100, QQQ...
2. Create Alert: Condition = this strategy, then "alert() function calls only". TradingView calls this a technical alert, and a free Basic account cannot create one - Basic allows 3 price alerts and no technical alerts at all, so the Create Alert dialog will not let you save it. Essential is the lowest plan that works (20 technical alerts); Plus 100, Premium 400. On Essential and Plus an alert also expires after two months and has to be created again; on Premium and Ultimate it does not expire. Phone notifications themselves are free on every plan - tick "Notify on app" and have the TradingView app installed and signed in on the same account.
3. Each message is one short line: what happened and at what price first, then the exchange and ticker, then the extras, separated by "|".
LONG 21455.75 on CME_MINI:NQ1! | SL 20455.00 then 21280.00 | TP 21640.50 | flat 16:09 ET | fills next open
EXIT 21280.00 on CME_MINI:NQ1! | Stop | -175.75 pts | position 0
LONG SKIPPED on PEPPERSTONE:NAS100 | opposite position open
SHORT SKIPPED on NASDAQ:QQQ | 20-day range not ready
ARMED on CAPITALCOM:NAS100 | LONG if price reaches ~21470.10
The ticker is in every line, so you can watch several Nasdaq symbols at once and still tell them apart. Alerts are per chart: create one on each symbol you want watched.
4. Messages fire once per bar close. Four toggles in the Alerts group: signals and exits (on), "setup armed" at 75 % of the threshold and "skipped signals" (both off by default). No alerts on non-Nasdaq symbols unless the market lock is overridden.
5. Free Basic plan, the nearest workaround: the status box's last row prints an approximate "Price alert" level - where the next up- or down-move would complete (both sides until one gets close, then the live one). A Basic account cannot alert on the strategy, but it can set a plain price alert on the symbol at that number (Alt+A, Condition = the symbol, "Crossing", Notify on app). Be clear about what it is: the detector measures bar CLOSES, so a touch alert fires earlier and sometimes without a trade, and the threshold is recomputed every bar, so the number moves. Treat it as "go and look at the chart", never as a signal.
Settings
- Market lock: "Allow orders on non-Nasdaq symbols (override)", off by default. The Nasdaq-100 is recognised by its contract root or ticker together with the instrument type, so futures, index / CFD quotes and the Nasdaq-100 ETFs are all accepted while a single share is not.
- Rule parameters (defaults): threshold multiple 2.0, 20 returns, 60-minute spacing, U from 20 sessions, 2.0 U first stop, 0.35 U stop after 300 seconds, 0.5 x IB extension, 60-minute IB. Session windows: 09:30 ET, 16:00 ET minus 5 s (15:59:55 ET), 16:09 ET. Changing them changes the strategy.
- Properties default to 1 contract per entry, pyramiding 10, 100,000 starting capital, 5% margin, 0.95 commission per contract per side (micro), 1 tick slippage, and limit fills only when price trades 1 tick through. "1 contract" is the size of each entry, not the maximum position. At 5% margin and 100,000 starting capital a 7-contract stack is only fundable on MNQ; on NQ the margin setting limits the stack, so set Properties for the instrument you actually trade. Enter your own size and cost - these defaults are wrong for CFDs, for ETFs and for full-size NQ.
Limits, and what this cannot do
- Different Nasdaq symbols are different data: a CFD feed, a futures contract and an ETF do not print the same bars, do not keep the same hours and do not start their day at the same time, so the same rule produces a different trade list on each. Read each one on its own chart.
- The chart must contain the session from 18:00 ET; the first loaded session is skipped and the threshold needs about 5 hours 15 minutes of bars each session. On an ETF that means switching the chart to extended hours; on a cash index symbol it cannot be fixed.
- Pine sees one price per bar, so events can come earlier, later or not at all compared with tick data; fills are at the next bar's open plus 1 tick. Results on chart bars can differ from live fills. The detector is evaluated on each chart bar's close, so a different chart timeframe produces a different set of signals.
- U comes from TradingView daily bars and can differ around rolls and holidays. Early-close days use the normal times, and because there is no bar at 16:09 ET on an early close, an open trade is closed at the start of the next session instead.
Educational tool. Not financial advice. Past behaviour does not predict future results.
Before you decide
The script page on TradingView carries TradingView's own Strategy Tester report, generated by TradingView from this script. We do not write those numbers and we do not repeat them here. Read them at the source: Nasdaq Surge Detector on TradingView.