Member-only story
Identify NR4 Candles for a stock Using Python and Zerodha
6 min readSep 25, 2023
Narrow Range 4 (NR4) Pattern:
The Narrow Range 4 (NR4) pattern is a technical analysis pattern used by traders to identify potential breakouts or significant price moves in a financial instrument, such as a stock. This pattern focuses on the trading range or volatility of a stock over a specific period, typically four trading days.
Here’s how the NR4 pattern is defined:
- Narrow Range: The NR4 pattern occurs when the trading range (the difference between the high and low prices) of a particular trading day is narrower than the trading ranges of the previous three trading days.
- Four-Day Period: The NR4 pattern looks at a four-day period, including the current trading day and the previous three trading days.
- Breakout Signal: When an NR4 pattern is detected, traders often interpret it as a potential signal for an impending breakout. A breakout could be in either direction, meaning that the stock’s price may break out to the upside (bullish) or to the downside (bearish) shortly after the NR4 pattern appears.
- Volatility Contraction: The NR4 pattern suggests a contraction in price volatility, where the market is experiencing a period of relatively quiet or narrow trading ranges. Traders anticipate that this period of reduced volatility will be followed by a period of increased volatility, leading to a price movement.
# # Iterate through historical…