Quiet Night Breakout
- The S&P 500 ETFs SPY, VOO, IVV and SPLG, when the symbol is an ETF (a fund). They pass the lock but cannot trade either, see below.
- Market
- the S&P 500, under any of the names the market lock recognises.
- Runs on
- an S&P 500 feed that quotes the whole 18:00-17:00 ET session - ES1!, MES1!, or an index / CFD feed such as SPX500, SPX500USD, US500 or US500USD - with the chart on electronic (24h) hours.
Free on request during the launch period.
Open on TradingViewThe rules, in full
- Overnight range = highest and lowest price from 18:00 ET the evening before until 09:30 ET.
- Day filter at 09:30 ET: the overnight range must be at most 0.50 x ADR20 (average 09:30-16:00 range of the prior 20 normal sessions) and the 09:30 open must be inside the overnight range. U = median full-session (18:00-17:00) range of the prior 20 sessions; the 20th must be at most 40 calendar days back. Holiday and incomplete sessions are left out. If U or ADR20 is not available, or there is no bar at 09:30, the day is skipped.
- Signal: bars are grouped in fixed blocks counted from 18:00 ET (30, 15, 18, 6 or 60 minutes, by variant). The first block that starts at or after 09:30 and ends between 09:35 and 11:30 ET with a close beyond the overnight range gives the signal. For the 60-min variant only the 10:00-11:00 block can qualify.
- Entry: market order after the signal bar closes (fills at the next bar's open). First side only, one trade per day. If the stop cannot be computed, no order is sent and the day is done.
- Stop: 30-min = overnight midpoint (distance kept between 0.03 and 0.60 U); 15-min = 0.35 U; 18-min = 0.20 U; 6-min = 2 x ATR14 of 5-minute bars (0.03 to 1.0 U); 60-min = other side of the 09:30-10:00 range, 1 tick beyond it (0.03 to 1.0 U).
- Exit: no target in any variant. The 30-, 15- and 18-min variants exit at market after a 5-, 15- or 3-minute bar closes back inside the overnight range, otherwise at 15:55 ET. The 6-min variant exits about 30 minutes after entry (first bar ending 31+ minutes after the entry bar opens) if price has not moved at least half the stop distance in its favour, otherwise at 16:10 ET. The 60-min variant exits at 15:00 ET. Anything still open is closed at 16:10 ET.
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 or red ▼ SHORT label above the bar where the entry filled (the bar after the signal bar, same bar as the Strategy Tester's entry marker; hover for the fill price, stop and exit rule). Optional highlight of the signal bar itself.
- "EXIT +/- pts" label at each exit (hover for the reason and P/L).
- Overnight high, low and midpoint lines, and blue shading while the signal window is open.
- In a trade: white entry line (the fill price), red stop line (the stop order live on each bar), light red zone between.
- Blue shading covers only the bars whose block can still give today's signal (for the 60-min variant, 10:00-11:00).
- Each level line is named with its price at its right end (ON high, ON low, ON mid, Entry, Stop; "Stop (ON mid)" when they coincide).
- Compact status box (top right): the symbol and how it was read (S&P 500 futures / index / CFD / ETF) with the variant; the state (WAITING, SETUP ARMED, ENTERING LONG / SHORT, IN LONG / IN SHORT, NO TRADE today, Done today), overnight levels, the filter result and signal count (hover a row for more); plus an orange row on any accepted symbol that is not ES / MES futures: about Properties and the overnight hours (index / CFD), about the missing overnight session (ETF), or about size, commission and hours (anything else allowed through, e.g. with the override on). Turn on "Show details" for range vs ADR, bars, U, stop, exit rule and next step.
- Red banner on any symbol that is not an S&P 500 instrument (no orders unless the market lock is overridden). Centre banner naming the chart to switch to when the timeframe cannot run the variant; small yellow tip when it works but is not the recommended one.
Alerts
1. Add the strategy to a 5-minute chart of an overnight S&P 500 symbol - ES1!, MES1!, SPX500, US500... (3-minute for the 18-min variant, 1-minute for the 6-min variant) and pick the variant.
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 "|". Nothing else to read.
ARMED on CME_MINI:ES1! | 30-min | ON 6012.25 / 6002.00 | break by 11:30 ET
LONG 6013.00 on CME_MINI:ES1! | SL 5998.50 | no TP | fills next open | exit: 5-min close back inside, else 15:55 ET
EXIT at market on CME_MINI:ES1! | closed back inside range | fills next open
EXIT 5998.50 on OANDA:SPX500USD | Stop hit | -14.50 pts | position 0
The ticker is in every line, so you can watch several S&P 500 symbols at once and still tell them apart at a glance. Alerts are per chart: create one on each symbol you want watched.
4. Messages fire once per bar close. Three toggles in the Alerts group: the signal (on), the exit (on) and the armed setup (off by default).
5. FREE BASIC PLAN - the "Price alert" row. A Basic account cannot create the alert in step 2 at all, so the status box prints a "Price alert" row instead: the overnight range high and low once the day is armed, "none yet" otherwise.
Those numbers go into ordinary price alerts on the SYMBOL (Alt+A, Condition = ES1! / MES1! / your index feed and not the strategy, operator "Crossing", tick "Notify on app"), which Basic does allow - three of them, and editing one does not use up another.
It rings when price reaches the level, not when the strategy trades: the rule still needs a block to CLOSE beyond the range inside the signal window, so it will sometimes ring on a day with no trade. Treat it as "look at the chart now". The range is two-sided, so it needs two alerts.
Settings
- Variant: pick one of the five.
- Setup filter and Stops and exits: the default rule values (0.50 x ADR20, ADR 20 sessions, first signal 5 min after 09:30, last 11:30 ET, U = 20 sessions within 40 days, stop multiples, 15:55 / 15:00 / 16:10 ET) define the strategy. Changing them changes the strategy.
- Market lock: "Override market lock (allow non-S&P symbols)" is off by default. The S&P 500 is recognised by its contract root or ticker together with the instrument type: the futures roots ES and MES; any index, CFD or forex-type ticker beginning with SPX, US500, SP500 or USA500; and the ETFs SPY, VOO, IVV and SPLG. A single share, another index or any other futures root is not accepted. Passing the lock is not the same as being tradable - a symbol with no overnight session passes and still never trades. Turn the override on only to experiment elsewhere.
- Display Options and Colors: levels, window shading, labels and label size, signal-bar highlight, status table and position, Show details, dark theme.
- Properties default to 50,000 initial capital, 1 contract, 0.95 commission per contract per side (micro), 1 tick slippage, no pyramiding, 10% margin. Enter your own size and cost for the instrument you trade - these defaults are wrong for full-size ES, for an index CFD (where 1 contract is 1 index point) and for an ETF.
Limits, and what this cannot do
- Pine fills at the next bar's open plus 1 tick and estimates the price path inside each bar (stops are judged from bar high/low); results on chart bars can differ from live fills.
- The five variants often trade the same days, so their results are related, not separate.
- Different S&P 500 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 daily bar at the same time, so the same rule produces a different trade list on each. Read each one on its own chart.
- ADR20 and U are built from 15-minute bars (chart bars if the chart is 30-minute) and need at least 20 prior sessions loaded (about one month of history). On futures use a continuous contract (ES1! / MES1!); roll adjustment can shift the levels.
- A day trades only if the chart data for that session starts by 18:05 ET. There is no early-close rule: on shortened sessions a trade still open when the data stops is closed at the start of the next session.
- 30-, 15- and 18-min variants: on the entry bar the stop is an estimate from the signal close; it is reset from the fill on the next bar. 6- and 60-min variants: the stop is placed from the bar after the fill. The stop line follows this.
- The chart must use electronic (24h) trading hours; with "Regular trading hours" there is no overnight data and every day is skipped. The same applies to any symbol that has no overnight session of its own: the S&P 500 ETFs (SPY, VOO, IVV, SPLG), the cash index (SPX, SPXUSD) and any index / CFD feed that pauses overnight never trade here, whatever the chart settings. They are accepted by the market lock all the same, so the absence of the red banner is not a sign that the symbol can trade.
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: Quiet Night Breakout on TradingView.