The Relative Equal Highs/Lows (REHL) indicator is a powerful tool for traders seeking to compare the strength of two or more assets. By analyzing the highs and lows of each asset, REHL provides a clear, quantitative measure of which market is leading or lagging. This comprehensive guide will walk you through the theory, calculation, practical applications, and advanced strategies for using the REHL indicator in your trading. Whether you are a beginner or a seasoned professional, you will gain actionable insights and real-world code examples to implement REHL in your trading toolkit.
1. Hook & Introduction
Imagine you are watching two stocks—let's say Apple and Google—move almost in sync. You want to know which one is showing more strength and which is lagging. This is where the Relative Equal Highs/Lows (REHL) indicator comes in. By comparing the highs and lows of both assets, REHL helps you spot subtle shifts in market leadership. In this article, you will learn how to calculate, interpret, and apply the REHL indicator, with practical code examples and trading scenarios. By the end, you will be equipped to use REHL for smarter, more confident trading decisions.
2. What is the Relative Equal Highs/Lows Indicator?
The Relative Equal Highs/Lows (REHL) indicator is a technical analysis tool designed to compare the price ranges of two or more assets. It does this by taking the difference between the high and low prices of each asset and forming a ratio. This ratio reveals which asset is relatively stronger or weaker over a given period. The REHL indicator was popularized by Larry Williams in the late 1980s, primarily for use in commodity markets, but its utility extends to stocks, ETFs, forex, and cryptocurrencies.
Unlike single-asset indicators such as RSI or MACD, REHL is inherently comparative. It is especially useful for pairs trading, sector rotation, and identifying divergences between correlated assets. By focusing on relative price action, REHL helps traders avoid false signals that can arise from analyzing assets in isolation.
3. Mathematical Formula & Calculation
The calculation of the REHL indicator is straightforward but powerful. Here is the core formula:
REHL Ratio = (High of Asset A - Low of Asset A) / (High of Asset B - Low of Asset B)
Let’s break this down with a worked example:
- High of Asset A (Apple): 150
- Low of Asset A (Apple): 140
- High of Asset B (Google): 100
- Low of Asset B (Google): 95
REHL Ratio = (150 - 140) / (100 - 95) = 10 / 5 = 2.0
A ratio above 1 means Asset A is showing more strength than Asset B. A ratio below 1 means Asset B is stronger. This simple calculation can be applied to any timeframe—daily, weekly, or intraday—depending on your trading style.
4. How Does the REHL Indicator Work?
The REHL indicator works by quantifying the price range of two assets and comparing them. It is a trend-following and relative strength tool. Here’s how it operates in practice:
- Collect the high and low prices for both assets over the same period.
- Calculate the price range for each asset (high minus low).
- Divide the range of Asset A by the range of Asset B to get the REHL ratio.
This ratio tells you which asset is outperforming. If the ratio is rising, Asset A is gaining strength relative to Asset B. If it is falling, Asset B is taking the lead. Traders use this information to make decisions about which asset to buy, sell, or hold.
5. Why is the REHL Indicator Important?
The REHL indicator addresses a key challenge in trading: identifying which asset is leading and which is lagging. This is crucial for pairs trading, sector rotation, and market divergence strategies. By providing a clear, quantitative measure of relative strength, REHL helps traders:
- Spot early trend shifts between correlated assets.
- Avoid false signals from single-asset indicators.
- Enhance risk management by focusing on the stronger asset.
However, REHL is not a silver bullet. It can give false signals in choppy, sideways markets or when assets are highly correlated. It is best used in conjunction with other indicators and within a broader trading strategy.
6. Interpretation & Trading Signals
Interpreting the REHL indicator is straightforward:
- REHL > 1: Asset A is relatively stronger (potential buy signal for Asset A).
- REHL < 1: Asset B is relatively stronger (potential buy signal for Asset B).
- Sudden changes in the ratio can signal early trend shifts.
Let’s look at a trading scenario:
A trader is comparing the S&P 500 ETF (SPY) and the Nasdaq ETF (QQQ). Over the past week, the REHL ratio has risen from 0.9 to 1.2. This suggests that SPY is gaining strength relative to QQQ. The trader decides to overweight SPY in their portfolio.
Common mistakes include ignoring market context, using REHL in isolation, or applying it to highly correlated assets. Always confirm REHL signals with other indicators and fundamental analysis.
7. Combining REHL with Other Indicators
REHL works best when combined with other technical indicators. Here are some popular combinations:
- RSI (Relative Strength Index): Use RSI to confirm momentum. Only take REHL signals when RSI indicates overbought or oversold conditions.
- MACD (Moving Average Convergence Divergence): Use MACD to confirm trend direction. Combine REHL and MACD for higher-probability trades.
- ATR (Average True Range): Use ATR to filter out trades in low-volatility environments.
Example Confluence Strategy: Only take REHL buy signals when RSI is above 50 and MACD is positive.
8. Real-World Code Examples
Implementing the REHL indicator in your trading platform is straightforward. Here are Code Example:
// C++ Example
#include <iostream>
struct Asset {
double high;
double low;
};
double rehl(const Asset& a, const Asset& b) {
return (a.high - a.low) / (b.high - b.low);
}
int main() {
Asset apple = {150, 140};
Asset google = {100, 95};
std::cout << "REHL Ratio: " << rehl(apple, google) << std::endl;
return 0;
}# Python Example
def rehl(asset_a, asset_b):
return (asset_a['high'] - asset_a['low']) / (asset_b['high'] - asset_b['low'])
asset_a = {'high': 150, 'low': 140}
asset_b = {'high': 100, 'low': 95}
print('REHL Ratio:', rehl(asset_a, asset_b))// Node.js Example
function rehl(assetA, assetB) {
return (assetA.high - assetA.low) / (assetB.high - assetB.low);
}
const assetA = { high: 150, low: 140 };
const assetB = { high: 100, low: 95 };
console.log('REHL Ratio:', rehl(assetA, assetB));// Pine Script v5: Relative Equal Highs/Lows Indicator
//@version=5
indicator("Relative Equal Highs/Lows", overlay=false)
marketA = input.symbol("AAPL", "Market A")
marketB = input.symbol("GOOGL", "Market B")
highA = request.security(marketA, timeframe.period, high)
lowA = request.security(marketA, timeframe.period, low)
highB = request.security(marketB, timeframe.period, high)
lowB = request.security(marketB, timeframe.period, low)
rehlRatio = (highA - lowA) / (highB - lowB)
plot(rehlRatio, color=color.blue, title="REHL Ratio")// MetaTrader 5 Example
#property indicator_chart_window
input string symbolA = "AAPL";
input string symbolB = "GOOGL";
double rehlRatio[];
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
ArraySetAsSeries(high, true);
ArraySetAsSeries(low, true);
for(int i=0; i < rates_total; i++) {
double rangeA = iHigh(symbolA, 0, i) - iLow(symbolA, 0, i);
double rangeB = iHigh(symbolB, 0, i) - iLow(symbolB, 0, i);
rehlRatio[i] = rangeB != 0 ? rangeA / rangeB : 0;
}
return(rates_total);
}9. Customization & Alerts
The REHL indicator can be customized to fit your trading style. Here are some options:
- Change the assets: Compare any two stocks, ETFs, or cryptocurrencies by modifying the input symbols.
- Adjust the timeframe: Use daily, weekly, or intraday data depending on your strategy.
- Add alerts: Set up alerts when the REHL ratio crosses key thresholds (e.g., above 1 or below 1).
Example Pine Script alert:
alertcondition(rehlRatio > 1, title="REHL Buy", message="REHL Buy Signal")
Combine REHL with other indicators by adding their code below the REHL calculation. This allows for more robust trading signals and better risk management.
10. Practical Trading Scenarios
Let’s explore some real-world trading scenarios where the REHL indicator shines:
- Pairs Trading: A trader compares two highly correlated stocks (e.g., Coke and Pepsi). When the REHL ratio shifts, they go long the stronger stock and short the weaker one.
- Sector Rotation: An investor uses REHL to compare sector ETFs (e.g., Technology vs. Utilities) and rotates capital into the leading sector.
- Market Divergence: A swing trader spots a divergence between the S&P 500 and the Nasdaq using REHL, signaling a potential reversal.
In each case, the REHL indicator provides a quantitative edge by highlighting relative strength and weakness.
11. Backtesting & Performance
Backtesting is essential to validate the effectiveness of the REHL indicator. Here’s how you can set up a simple backtest in Python:
# Python Backtest Example
import pandas as pd
# Assume df_a and df_b are DataFrames with 'high' and 'low' columns for Asset A and B
df_a['range'] = df_a['high'] - df_a['low']
df_b['range'] = df_b['high'] - df_b['low']
df_a['rehl'] = df_a['range'] / df_b['range']
# Generate signals: Buy Asset A when REHL > 1, Buy Asset B when REHL < 1
df_a['signal'] = 0
df_a.loc[df_a['rehl'] > 1, 'signal'] = 1
df_a.loc[df_a['rehl'] < 1, 'signal'] = -1
# Calculate returns and win rate as needed
In trending markets, REHL-based strategies often show higher win rates and better risk/reward ratios. In sideways or highly correlated markets, performance may suffer due to false signals. Always backtest on historical data before deploying in live trading.
12. Advanced Variations
Advanced traders and institutions often tweak the REHL formula or use it in specialized ways:
- Moving Averages: Use moving averages of highs and lows for smoother signals.
- Multi-Asset Comparison: Compare more than two assets by creating a composite REHL ratio.
- Options Trading: Use REHL to identify volatility arbitrage opportunities between related assets.
- Scalping & Swing Trading: Apply REHL on shorter timeframes for scalping or longer timeframes for swing trading.
Institutions may combine REHL with machine learning models or use it as part of a larger quantitative strategy.
13. Common Pitfalls & Myths
Despite its strengths, the REHL indicator is not foolproof. Here are some common pitfalls and myths:
- Misinterpretation: Assuming REHL always predicts reversals. It is a relative strength tool, not a reversal indicator.
- Over-Reliance: Using REHL in isolation without confirming signals from other indicators or fundamental analysis.
- Signal Lag: Like all indicators, REHL can lag in fast-moving markets. Use with caution during high volatility.
- Ignoring Correlation: Applying REHL to highly correlated assets can lead to false signals.
To avoid these pitfalls, always use REHL as part of a broader trading strategy and confirm signals with multiple sources.
14. Conclusion & Summary
The Relative Equal Highs/Lows (REHL) indicator is a versatile and powerful tool for comparing the strength of two or more assets. Its simple calculation belies its effectiveness in pairs trading, sector rotation, and market divergence strategies. By focusing on relative price action, REHL helps traders make more informed decisions and avoid common pitfalls of single-asset analysis.
Best scenarios to apply REHL include trending markets, sector rotation, and pairs trading. Avoid using it in highly correlated or sideways markets without additional confirmation. Related indicators to explore include RSI, MACD, and ATR. By integrating REHL into your trading toolkit, you can gain a quantitative edge and trade with greater confidence.
TheWallStreetBulls