The Narrow Range theory (NR4 and NR7)
The Narrow Range theory is a way of quantifying how markets can move from a consolidation period (the range) to a trending period. It’s based on the logic that a narrow range can indicate a balance between buyers and sellers, which is evidence of rest. Once the price breaks out of this resting phase, price movements can become a trend leading to a clear short-term move in one direction. The trade is an attempt to catch this short-term trend as soon as the price breaks out of the range.
Step 0: Access the Strategy Concept Template [1 Min]
Click the button to load the trading bot directly onto your canvas:
Templates are for educational purposes only.
The template is designed to run on the Daily Timeframe.
Your canvas should display these blocks. Check? Let's continue!
Step 1: Export the Trading Bot [1 Min]
Before diving into customization, export the bot with the upper-right export button to download the file.
Step 2: Upload to MetaTrader 5 [4 Min]
Don’t know how? Refer to our help article "Exporting Your First Strategy".
Step 3: Understand the Logic [10 Min]
Let’s start building this strategy. We divide it into 3 sections.
Finding the NR4. In this section, we want to find the NR4 candle. That is the inside bar, with the smallest range of the past 3 candles before it. To find the inside bar, we use 2 trade rule blocks to specify that the high of the candle is below the high of the candle before it, and the low of the candle is above the low of the candle before it. To make sure it’s the narrowest range candle, we need a small and simple loop. The trade rule block to define the narrow range is simply:
Candle total size for Candle ID 1 is smaller than Candle total size for Candle ID x.
Candle ID x is the candle before. So, we compare the total candle size of the inside bar candle with 3 candles before that to make sure it’s the smallest of the 3. The loop adds 1 candle to eventually find the 3 in a row. The last Trade rule block makes sure that the loop stops once a total of 4 candles have been considered to complete the NR4 pattern. If we want to change this to an NR7 pattern, we simply put the lookback to 7 candles instead of 4.
Trade the NR4. If the NR4 pattern is confirmed, the Greenlight variable is set to OK. This means that the system can start looking for trades. The first check if there are no open trades yet. If that’s the case, the system looks for a cross of the high or the low of the inside bar to take a buy or sell trade. After a trade is taken, the trade counter is set to 1, so no more trades on that day can be taken in that direction.
Reset the Trade Counter. At the end of each trading day, the system resets all variables back to their default settings so the entire process from start to finish can be run the next day again.
This is what the strategy looks like on a chart.
Step 4: Make It Your Own [10 Min]
You can adjust and experiment:
Add more strategy rules or include the NR4 pattern component in your own strategies
EXPORT and see the differences.
Play around with timeframes and assets
EXPORT and see the differences.
Refine the rules to fit your own interpretation of the NR4 concept
EXPORT and see the differences.
Templates are for educational purposes only.
The template is designed to run on the Daily Timeframe.
Conclusion
The NR4 pattern is a unique way of identifying consolidation phases and anticipating a breakout and the start of a short-term trend. It's mechanical and universally applicable across all markets. Now it's your turn—apply the template, tweak the logic, and make it yours. 🚀



