A trading bot explains, in its own voice, the logic of how it trades on the market.
At the core of this trading algorithm lies the breakout of a defined ORB (Opening Range Breakout) range π, formed at the opening of the trading session and confirmed by a gap. As we know, the first minutes of trading (usually 5-15 minutes) are a period of high volatility when the market “digests” overnight news, orders, and establishes the initial balance. The Opening Range is the range between the high and low of this period.
A breakout of this range can indicate that one side (buyers or sellers) has overpowered the other and taken control. If this breakout is also confirmed by a gap, which itself is a strong support or resistance zone, it strengthens the signal. π In addition to the gap, according to the strategy’s conditions, entry into a position is confirmed by a trend filter to reduce the risk of opening a position against the market, as well as a volume filter, since high volume can indicate the presence of strong players in the market capable of moving the price in the desired direction.
The ORB range can be customized in the settings by selecting the number of candles from whose highs and lows it is built. This allows for empirically finding the optimal strategy settings for a specific asset. The strategy provides clear and understandable risk management based on the risk/reward ratio with a justified stop loss placed beyond the ORB range boundary.
The algorithm includes an option to limit the number of trades executed during the day, as in a flat market phase, there can be several false breakouts of the ORB range per day. βοΈ Precise configuration of the market open time allows building a trading strategy for both US and European trading sessions.
How It Works:
After the start of the set trading session, the algorithm determines the trading range based on the highs and lows of the selected number of candles.
The script waits for a breakout above the upper or below the lower boundary of this range, requiring a candle close for confirmation.
When the breakout occurs, the script analyzes the gap that took place at the opening of the trading session. If the gap was bearish, only short trades are allowed that day; if it was bullish, only long trades are allowed.
Next, entry signals are filtered using the SuperTrend indicator. Opening a trade is only permitted in the direction of the trend.
And finally, the script analyzes the volume at the moment of a potential signal. Entry into a position is allowed if the volume is above the level specified in the settings.
If all conditions are met, the script opens a position.
Risk Management
After opening a position, the stop loss is set below the range boundary for long positions and above for short positions. The take profit is regulated in the trading algorithm settings via the risk/reward ratio coefficient.
Strategy Settings
Hour/Minute – Start time of the session for ORB calculation (default set to 9: 30 – start of the US trading session).
GMT – Timezone for the trading session (default: New York).
ORB Bars Count – Number of candles for building the range (default 1; for lower timeframes, this number can be increased).
Risk/Reward Ratio – Risk/profit ratio (default 2.5; empirically, values from 2 to 4 have been found to work optimally).
Enable Gap Filter – Gap filter (activated by default).
Enable One Trade Per Day – Limit of one trade per day (deactivated by default, but on lower timeframes it is sometimes worth enabling this filter due to the high number of false intraday breakouts).
Enable Supertrend Filter – Activates the trend filter.
Enable Volume Filter – Volume filter (activates the volume filter, enabled by default).
Minimum Volume Multiplier – Minimum volume relative to the average (default 0.6).
Supertrend ATR Period/Factor – Parameters of the SuperTrend indicator (default ATR – 7, factor – 3).
Disclaimer
Backtest results are not guaranteed to repeat in the future. The market is unpredictable, and no one knows where the price will go in the future or how this algorithm will behave under different market conditions.
The strategy author does not encourage anyone to use this trading algorithm, deposit funds into an exchange, or anywhere else.
The strategy author is not responsible for failures of the exchange or platform transmitting the trading algorithm’s signals. Each user is solely responsible for any financial decisions made, for adhering to risk and money management.
It is highly discouraged to:
Use this strategy on timeframes lower than 15 minutes, as the market is particularly manipulative and unpredictable on lower timeframes;
Please, do not perceive this strategy as the Holy Grail. This script is merely a trader’s tool for backtesting a specific trading algorithm on any msrkets, assets and timeframes to make more informed trading decisions, as well as for automating trading using the TradingView platform.