AlgoBot ORB (Opening Range Breakout) is a session-based breakout strategy for TradingView that automates the classic ORB approach. It defines an opening range for a selected session, validates its size, and then reacts to breakouts with configurable take-profit and stop-loss levels. The script operates as a full strategy, so traders can both backtest and forward-test the logic. With control over trade direction, breakout behavior, position management, and rich alert templates, AlgoBot ORB offers a structured way to trade intraday volatility around the opening range.
Configurable Session and Timezone
Define the active trading session using custom session hours and a selectable timezone. The strategy only evaluates and trades ORB signals within this window, keeping the logic focused on your preferred market hours.

Opening Range Duration and Validity Filters
Set the opening range duration in minutes and let the script automatically compute ORB high and low. Minimum and maximum ORB size filters (in percent of ORB low) help avoid very small or excessively wide ranges, with valid ORBs highlighted differently on the chart.

Built-In Timeframe Consistency Check
The strategy enforces a logical relationship between chart timeframe and ORB duration, preventing incompatible combinations. This reduces configuration errors that could otherwise distort ORB calculations and signals.

Percentage-Based Take-Profit and Stop-Loss
Configure profit target and stop-loss distances as percentages of the ORB range. TP and SL levels are calculated automatically for each breakout and can be used both for execution and for visual reference on the chart

Flexible Trade Direction and Breakout Mode
Choose whether to trade both directions, only long, or only short. Breakout handling can be set to take only the first valid ORB breakout per session or to react to every valid breakout while the strategy is flat.

Position Management and Forced Close Time
Allow the strategy to reverse an existing position when an opposite breakout occurs, or restrict it to flat-only entries. Additionally, you can force-close all open positions at a specified time in the chosen timezone, which is useful for end-of-session risk management.

Visual Signals and ORB Display
Enable chart-based BUY/SELL arrows together with TP/SL lines to see where each trade was triggered and its associated levels. ORB high/low lines and fills clearly show the calculation window and whether the range met the configured size criteria. Disable it to see only ORB and keep the chart clean.

Advanced Alert Templates with Placeholders
Define custom alert messages for BUY and SELL signals using placeholders for prices, distances, ticks, pips, and contextual data such as ticker, timeframe, and time. Alerts are fired on valid breakout entries, making the strategy easy to integrate with notifications or external execution tools.

How to Use
The Opening Range Breakout method aims to capture directional momentum that often emerges after the market establishes its initial range at the start of a session. AlgoBot ORB first measures this early-session range, validates its size, and then waits for the price (candle close) to break above or below it. Once the range is set, traders typically look for a clean close beyond the ORB high to consider long opportunities or a close below the ORB low to consider short setups. Take-profit and stop-loss levels are derived automatically from the ORB range, providing a structured risk framework. Whether used with the “first breakout per session” or “every breakout” mode, the goal is consistent: trade in the direction of early-session expansion while keeping risk defined and controlled.
AlgoBot ORB Key Features Summary:
- Defines session-based opening range using selectable timezone and hours
- Filters ORB ranges by configurable minimum and maximum size thresholds
- Validates chart timeframe against ORB duration to avoid configuration errors
- Calculates TP and SL as percentages of the ORB range for each breakout
- Lets traders choose trade direction and breakout handling per session
- Manages positions with optional reversal and forced end-of-day close
- Visualizes ORB, entries, and TP/SL levels with chart arrows and lines
- Sends customizable BUY/SELL alerts with rich placeholders for prices and distances






