OPEN-SOURCE SCRIPT

Range Expansion Index (REI)

113
Range Expansion Index (REI)

Overview
This script presents a powerful implementation of the Range Expansion Index (REI), an oscillator developed by the legendary market technician T.D. Its primary purpose is to identify potential trend reversals by detecting "trend exhaustion" in overbought and oversold zones.

This version offers a clean, precise, and easy-to-interpret implementation of the indicator, based on R.D original logic.

How to Use the Indicator
The REI oscillates between -100 and +100. The interpretation is intuitive and designed to generate clear signals:

  1. Overbought Zones and Sell Signals: When the REI rises above the (adjustable) "Overbought" line (e.g., +60), it indicates strong buying momentum. If this condition persists for a specified number of bars (definable via "Signal Duration"), a green down-arrow will appear. This is a signal of potential uptrend exhaustion and a pending downward correction.

  2. Oversold Zones and Buy Signals: If the REI falls below the "Oversold" line (e.g., -60) and remains there for the set "Signal Duration," a red up-arrow will appear. This signals that selling pressure may be waning and an upward move or trend reversal is imminent.

  3. Divergences: Look for divergences between the price and the REI. A bullish divergence (price makes a lower low, but the REI makes a higher low) is a strong buy signal. A bearish divergence (price makes a higher high, but the REI makes a lower high) is a strong sell signal.

  4. Confirmation: For best results, REI signals should be confirmed by other analysis methods such as price action, trend lines, volume, or other indicators.


Setting Options
The indicator is fully customizable to adapt it to different markets and timeframes:
  • [] Lengths (n, nL1, etc.): Control the oscillator's sensitivity. Shorter lengths react faster but may produce more false signals.
    [] Calculation Method: Choose between "Basic" and "Advanced" (with stricter conditions) to fine-tune the signal logic.
    [] Overbought/Oversold Levels: Define your own thresholds for signaling.
    [] Signal Duration (nD): A key filter. A higher number (e.g., 3 instead of 1) reduces the number of signals but increases their potential reliability, as the condition must be met for longer.


The REI is not a standalone trading system, but an excellent tool for identifying potential high-probability turning points. Always use it as part of a comprehensive trading strategy and solid risk management.


Happy trading!

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。