OPEN-SOURCE SCRIPT
ORB Continuation v1.0 - Signals + Levels

# ORB Continuation — Signals + Levels
An opening-range breakout (ORB) tool for intraday futures and index trading. It
marks the opening range, signals a confirmed breakout, and draws the full trade
map — entry, stop, target, a trailing "stop in profit," the time-based exit, and
a per-trade risk readout — so you can see and manage a breakout setup at a glance.
The design is built around a simple, well-documented intraday tendency: the order
imbalance set in the first part of the session often persists through the day, so
a range that breaks with conviction tends to keep going in the breakout direction.
## What it does
- Builds the **opening range** from the first N minutes of the session (default
30 minutes of the New York session) and marks the high and low as white dotted
lines, with the range period shaded.
- Signals a **breakout** only when a candle *closes* beyond the range (use it on
a 5-minute chart), optionally requiring the close to clear the level by a
minimum distance to filter weak pokes.
- Draws the **entry** (dotted), the **stop loss** (red, on the opposite side of
the range), and the **take-profit / target** (green).
- Switches the stop to a pink **"Stop in Profit"** line once the trade has run a
full 1R and the trailing logic engages, ratcheting under the most recent bars.
- Marks the **session-exit time** (a vertical line) and the **realized exit**
price when the simulated trade closes.
- Shows a **per-trade risk label** — the dollar risk of one contract for that
day's setup, plus a suggested contract count — to support consistent,
risk-based position sizing.
- One setup per day, long or short (shorts are an optional toggle).
## How the logic works
- **Entry:** a confirmed close beyond the opening range, in the breakout direction.
- **Stop:** the opposite side of the opening range (if price round-trips the whole
range, the breakout is invalidated).
- **Exit — two modes:**
- *Hold to close / trailing:* no fixed target; the stop trails after +1R and
the position is flat at the session-exit time. The green line acts as a 1R
reference.
- *Fixed R:R + time-stop:* a fixed take-profit at a chosen R multiple; flat at
the time-stop if neither level is hit.
- **Risk readout:** based on the stop distance and your chosen risk-per-trade and
point value, so you can keep every trade to the same intended risk.
## Settings
- **Session:** opening-range length, session open time, session-exit time, timezone.
- **Trade:** longs on/off, shorts on/off.
- **Exit:** mode (trailing or fixed R:R), R-multiple, trailing length.
- **Sizing (for the risk label):** risk per trade, USD per point, max contracts.
- **Filters (optional):** minimum breakout penetration, minimum/maximum range
width, EMA trend filter, entry time window, lunch skip.
- **Display:** toggles for every drawing element (ORB lines, shading, labels,
risk label, session-exit line, realized-exit marker).
## How to use
1. Apply it to a **5-minute chart** of your instrument (e.g., index futures).
2. Set the session times for your market and pick your exit mode.
3. Set the sizing inputs so the risk label reflects your account and instrument.
4. When a LONG/SHORT marker prints, the entry, stop and target are drawn and the
risk label shows what the trade risks. Set alerts (long, short, or either) to
be notified of breakouts.
## Notes
This is an indicator for study and discretionary use — it visualizes and signals
a setup; it does not place orders, and the levels shown (stop, target, trailing)
are a faithful simulation of the rules for guidance. In live trading your actual
fills, spread and slippage will differ.
Nothing here is financial advice or a recommendation to buy or sell. Markets carry
risk, including loss of capital; trading leveraged instruments such as futures can
result in losses exceeding deposits. Always test any approach on your own data and
manage your own risk. Past behavior of any setup does not guarantee future results.
An opening-range breakout (ORB) tool for intraday futures and index trading. It
marks the opening range, signals a confirmed breakout, and draws the full trade
map — entry, stop, target, a trailing "stop in profit," the time-based exit, and
a per-trade risk readout — so you can see and manage a breakout setup at a glance.
The design is built around a simple, well-documented intraday tendency: the order
imbalance set in the first part of the session often persists through the day, so
a range that breaks with conviction tends to keep going in the breakout direction.
## What it does
- Builds the **opening range** from the first N minutes of the session (default
30 minutes of the New York session) and marks the high and low as white dotted
lines, with the range period shaded.
- Signals a **breakout** only when a candle *closes* beyond the range (use it on
a 5-minute chart), optionally requiring the close to clear the level by a
minimum distance to filter weak pokes.
- Draws the **entry** (dotted), the **stop loss** (red, on the opposite side of
the range), and the **take-profit / target** (green).
- Switches the stop to a pink **"Stop in Profit"** line once the trade has run a
full 1R and the trailing logic engages, ratcheting under the most recent bars.
- Marks the **session-exit time** (a vertical line) and the **realized exit**
price when the simulated trade closes.
- Shows a **per-trade risk label** — the dollar risk of one contract for that
day's setup, plus a suggested contract count — to support consistent,
risk-based position sizing.
- One setup per day, long or short (shorts are an optional toggle).
## How the logic works
- **Entry:** a confirmed close beyond the opening range, in the breakout direction.
- **Stop:** the opposite side of the opening range (if price round-trips the whole
range, the breakout is invalidated).
- **Exit — two modes:**
- *Hold to close / trailing:* no fixed target; the stop trails after +1R and
the position is flat at the session-exit time. The green line acts as a 1R
reference.
- *Fixed R:R + time-stop:* a fixed take-profit at a chosen R multiple; flat at
the time-stop if neither level is hit.
- **Risk readout:** based on the stop distance and your chosen risk-per-trade and
point value, so you can keep every trade to the same intended risk.
## Settings
- **Session:** opening-range length, session open time, session-exit time, timezone.
- **Trade:** longs on/off, shorts on/off.
- **Exit:** mode (trailing or fixed R:R), R-multiple, trailing length.
- **Sizing (for the risk label):** risk per trade, USD per point, max contracts.
- **Filters (optional):** minimum breakout penetration, minimum/maximum range
width, EMA trend filter, entry time window, lunch skip.
- **Display:** toggles for every drawing element (ORB lines, shading, labels,
risk label, session-exit line, realized-exit marker).
## How to use
1. Apply it to a **5-minute chart** of your instrument (e.g., index futures).
2. Set the session times for your market and pick your exit mode.
3. Set the sizing inputs so the risk label reflects your account and instrument.
4. When a LONG/SHORT marker prints, the entry, stop and target are drawn and the
risk label shows what the trade risks. Set alerts (long, short, or either) to
be notified of breakouts.
## Notes
This is an indicator for study and discretionary use — it visualizes and signals
a setup; it does not place orders, and the levels shown (stop, target, trailing)
are a faithful simulation of the rules for guidance. In live trading your actual
fills, spread and slippage will differ.
Nothing here is financial advice or a recommendation to buy or sell. Markets carry
risk, including loss of capital; trading leveraged instruments such as futures can
result in losses exceeding deposits. Always test any approach on your own data and
manage your own risk. Past behavior of any setup does not guarantee future results.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.