OPEN-SOURCE SCRIPT

ORB+VWAP NY Bounce

832
ORB + VWAP Bounce — opening-range break with a resting VWAP retest

An intraday entry model for the 1-minute chart on index futures. It
combines an opening-range breakout filter with a mean-reversion entry,
and it only ever takes one trade per session.


THE IDEA IN ONE SENTENCE

The opening range breaks; a resting LIMIT order then waits at the
session VWAP and fills the moment price retests it in the direction of
that break.


HOW IT WORKS

Each session runs through three phases.

1. RANGE — the script records the high and low of the opening-range
window (09:30–10:00 New York by default). Nothing is armed until
this window closes.

2. BREAK — when price closes beyond that high or low, the side of the
break sets the direction for the rest of the day. Broke up = long
only. Broke down = short only. This is the only thing that decides
direction.

3. RETEST — from the start of the entry window, a limit order rests on
the session VWAP, anchored at the RTH open. A long fills on the
pullback down to it; a short fills on the rally up to it.


WHY THE ENTRY IS A RESTING LIMIT, NOT A MARKET ORDER

This is the part worth understanding before using it.

A buy limit can only rest BELOW the market, and a sell limit only
ABOVE it. So "price is on the correct side of VWAP" is not something
the script has to check — it is inherent to the order type itself. A
long only exists if price is above the VWAP and pulls back into it; a
short only exists if price is below and rallies into it.

That is why there is no separate trend filter or bias input in this
script: there would be nothing left for it to decide. The break sets
direction, the order type enforces location.

The trade-off is real and you should know it: a resting limit fills at
a known price but is not guaranteed to fill at all. Days where price
breaks and never returns to the VWAP simply produce no trade. The
script is designed to sit out far more often than it trades.


SETTINGS

Session / Time — timezone, the RTH session that defines the trading
day, the opening-range window, the entry window, and a forced flat
time. No position is ever carried overnight.

Entry Logic — direction (long only / short only / both), which VWAP
anchor the limit rests on (RTH open or Globex open), an optional tick
offset so the limit sits a hair on the approach side, and the maximum
number of trades per day.

Filters / Seasonality — day-of-week switches, month exclusions, and
separate gates for the short side only (a time cut-off, weak months,
and a weekday block). All of these are OFF or neutral by default. They
exist so you can test whether your own instrument and session show
asymmetries, not because any particular setting is recommended.

Setup Quality — an optional gate on the size of the opening range,
measured either in points or as a multiple of the previous day's ATR.
The ATR mode is self-scaling, so one setting holds across changing
volatility regimes. OFF by default.

Stop / Target — the stop can be a fixed tick distance, a multiple of
the daily ATR, the VWAP line itself, the opposite side of the opening
range, or a retest swing. Targets can be an R multiple, a multiple of
the range, a fixed tick distance, or none at all.

Trailing Stop — optional, by R multiple or by points, with a
configurable activation threshold. There is a switch to remove the
fixed target once the trail is active, so a runner is not capped.

Risk Management — position size derived from a fixed dollar risk and
the actual stop distance, or a fixed contract count. Note that the
derived size is a step function: contracts = floor(risk / (stop
distance x point value)). Small changes in risk can leave the contract
count unchanged, and then jump it by a whole contract.


WHAT ELSE IS ON THE CHART

A Market Positioning table compares price against five VWAPs (session,
overnight, previous session, high-of-day, low-of-day) plus the opening
range, for the chart symbol and two correlated tickers you choose. It
also reports the opening-range size in points and in ATR multiples,
and the daily ATR itself.

There is an optional risk:reward box drawn on each entry, and an
optional prop-firm tracker that reports balance, distance to a
trailing drawdown line, worst margin reached, and a consistency
measure.

Every order carries a JSON alert_message suitable for automation
platforms that parse webhook payloads.


BACKTESTING NOTES — PLEASE READ

Two Properties settings change results substantially on this script,
and both default to values that flatter it:

- Limit order execution. Every entry here is a limit order resting on
the VWAP. The "Requested price" setting assumes a fill the moment
price grazes the line without trading through it, which is
optimistic for a resting order. Use "Standard".

- Bar detalization. Set it to High. On a 1-minute chart with intrabar
stop and target logic, the default resolution is too coarse.

Also apply realistic commission and slippage for your instrument
before drawing any conclusion.


LIMITATIONS

This script takes at most one trade per session and requires both a
range break and a retest, so it trades infrequently. On any given
instrument the sample it produces over a few years may be small enough
that ordinary variance dominates. Treat any backtest of it as a
description of one particular past, not as an expectation.

Seasonal and day-of-week filters are especially easy to overfit: with
a handful of trades per month, apparent patterns appear by chance.
They ship neutral for that reason. If you turn them on, check that the
effect holds in every year of your sample independently, not just in
the total.

Defaults are a starting point for the instrument and session they were
written around. They are not tuned for yours.

Nothing here is financial advice.

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.