OPEN-SOURCE SCRIPT
Updated

Quantum Range Filter by MRKcoin

133
### Quantum Range Filter by MRKcoin

**Overview**

This indicator is a sophisticated range detection tool designed based on the principles of quantitative multi-factor models. Instead of relying on a single condition, it assesses the market from three different dimensions to provide a more robust and reliable identification of range-bound (sideways) markets.

When the background is highlighted in red, it indicates that the market is likely in a range phase, suggesting that trend-following strategies may be less effective, and mean-reversion (range trading) strategies could be more suitable.

---

**Core Logic: A Multi-Factor Approach**

The filter evaluates the market state using the following three independent factors:

1. **Momentum Volatility (RSI Bollinger Bandwidth):**
* **Question:** Is the momentum of the market contracting?
* **Method:** It measures the width of the Bollinger Bands applied to the RSI. A narrow bandwidth suggests that momentum is consolidating, which is a common characteristic of a range market.

2. **Price Volatility (ATR Ratio):**
* **Question:** Is the actual price movement shrinking?
* **Method:** It calculates the Average True Range (ATR) as a percentage of the closing price. A low ratio indicates that the price volatility itself is low, reinforcing the case for a range environment.

3. **Absence of Trend (ADX):**
* **Question:** Is there a lack of a clear directional trend?
* **Method:** It uses the Average Directional Index (ADX), a standard tool for measuring trend strength. A low ADX value provides active confirmation that the market is not in a trending phase.

---

**How to Use**

1. **Range Detection:** The primary use is to identify ranging markets. The red highlighted background serves as a visual cue.

2. **Strategy Selection:**
* **Inside the Red Zone:** Consider using range-trading strategies (e.g., buying at support, selling at resistance, using oscillators like RSI or Stochastics for overbought/oversold signals). Avoid using trend-following indicators like moving average crossovers, as they are prone to generating false signals in these conditions.
* **Outside the Red Zone:** The market is likely trending. Trend-following strategies are more appropriate.

3. **Parameter Tuning (In Settings):**
* **This is the key to adapting the filter to any market or timeframe.** Different assets (like BTC vs. ETH) and different timeframes have unique volatility characteristics. Don't hesitate to adjust the parameters to fit the specific chart you are analyzing.
* **Range Detection Score:** This is the most important setting. It determines how many of the three factors must agree to classify the market as a range. The default is `2`, which provides a good balance.
* If the filter seems **too sensitive** (highlighting too often), increase the score to `3`.
* If the filter seems **not sensitive enough** (missing obvious ranges), decrease the score to `1`.
* **Factor Thresholds:** For fine-tuning, adjust the thresholds for each factor.
* **`RSI BB Width Threshold`:** If you want to detect even tighter momentum consolidations, *decrease* this value.
* **`ATR Ratio Threshold`:** If you want to be stricter about price volatility, *decrease* this value.
* **`ADX Threshold`:** To be more lenient on what constitutes a "trendless" market, *increase* this value (e.g., to 30). To be stricter, *decrease* it (e.g., to 20).
* **Pro Tip:** Use the Debug Table (uncomment it in the script's code) to see the live values of each factor. This will give you a clear idea of how to set the thresholds for the specific asset you are trading.

**Disclaimer**

This indicator is a tool to assist in market analysis and should not be used as a standalone signal for making financial decisions. Always use it in conjunction with your own trading strategy, risk management, and analysis. Past performance is not indicative of future results.

**Credits**

* **Concept & Vision:** MRKcoin
Release Notes
//─ How to Tune (Quick Guide) ──────────────────────────────────────────────────
// Different assets (e.g., BTC vs. ETH) have unique volatility profiles.
// Adjust these parameters to fit the specific chart you are analyzing.
//
// 1. Range Detection Score (Main Control):
// - For MORE sensitivity (more red zones), set to 1.
// - For LESS sensitivity (stricter filtering), set to 3.
//
// 2. Thresholds (Fine-Tuning):
// - RSI BB Width: Lower value = Stricter (detects only extreme momentum consolidation).
// - ATR Ratio: Lower value = Stricter (detects only very low price volatility).
// - ADX: Lower value = Stricter (detects only completely dead trends).
// Higher value = More lenient (allows for some trendiness).
//──────────────────────────────────────────────────────────────────────────────

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.