OPEN-SOURCE SCRIPT
ORB PRO by John K

ORB PRO identifies four price-action setups using the Opening Range, external swing liquidity, and an EMA. It includes configurable sessions, candle filters, alerts, and optional stop-loss and take-profit boxes.
The default Opening Range is 09:30–09:45, with signals enabled from 09:45–12:00, New York time. Both sessions are adjustable.
**Liquidity Sweeps — LQ BUY / SELL**
Price sweeps a confirmed swing low below the ORB or a swing high above it, then closes back inside the range with a bullish candle for buys or a bearish candle for sells.
By default, the sweep and confirmation must occur on separate candles. An optional filter restricts liquidity to swings confirmed before 09:45. Liquidity inside the ORB is excluded.
**ORB Rejections — ORB BUY / SELL**
Price tests the ORB low as support or the ORB high as resistance. The signal candle must close inside the range, match the trade direction, and have a body strictly larger than the previous candle.
Wicks through the boundary are allowed. A prior close through that boundary, or an external liquidity sweep on that side, disables its ORB rejection signals for the session.
**Breakout Retests — BO BUY / SELL**
After an ORB breakout, price retests the broken boundary. Confirmation can occur on a qualifying directional retest candle or immediately after an opposite-colored retest:
• Buy: red retest followed immediately by a larger green candle closing above ORB high.
• Sell: green retest followed immediately by a larger red candle closing below ORB low.
Optional close tolerance permits a small retest close inside the range, but the entry must still close outside the actual ORB. A deeper failed close locks both ordinary BO directions for the session.
**EMA Breakout Retests — EMA BO BUY / SELL**
Price breaks the ORB and EMA, then retests the EMA and confirms with a larger directional candle beyond both levels.
An optional filter requires the EMA to be outside the ORB when the range forms. A wrong-side EMA close before confirmation locks both EMA BO directions for the session.
**Filters and Visual Tools**
• Adjustable ORB retest, BO close, and EMA retest tolerances: 0–100 ticks.
• Optional minimum body-to-range filter to reduce doji-like signals.
• Optional red stop-loss and green take-profit boxes.
• Stops based on the signal candle, ATR, opposite ORB boundary, or confirmed swing.
• Targets include 1R, 2R, custom R, ORB boundaries where applicable, and ORB extensions.
• Approximate ORB volume profile with highlighted point of control.
• Individual and combined buy/sell alerts.
Signals confirm at candle close. This is an indicator, not an automated trading or backtesting strategy. SL/TP boxes are visual references, and signals do not guarantee profitable outcomes.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.