PROTECTED SOURCE SCRIPT

RRG 1 stock

19
This Pine Script combines Relative Rotation Graph (RRG) analysis with Supertrend-based trend confirmation to identify momentum shifts and potential trade entries in a single stock relative to a benchmark (e.g., NIFTY). Here’s a detailed description you can use:

Description – RRG + Supertrend Indicator (1 Stock)
The RRG 1 Stock indicator blends relative strength analysis with trend-following confirmation to help traders pinpoint when a stock is outperforming or underperforming its benchmark and to align entries with trend direction.

Core logic:

Benchmark-relative strength (RS-Ratio and RS-Momentum):

Calculates relative strength (RS) of the selected stock versus a benchmark (default: NIFTY).

Applies double smoothed Weighted Moving Averages (WMA) to derive normalized RS-Ratio and RS-Momentum, similar to Julius de Kempenaer’s RRG framework.

Classifies each bar into one of four RRG quadrants:

Leading – strong and improving relative performance

Weakening – losing momentum after leadership

Lagging – underperforming the benchmark

Improving – rebounding from underperformance

The chart background color dynamically reflects the current quadrant.

Supertrend filters (Trend confirmation):

Uses two Supertrend overlays with different multipliers (Factor1, Factor2) to judge trend strength.

Potential long setups occur when the stock is in the Leading quadrant and price is above both Supertrends.

Potential short setups occur when in the Lagging quadrant and price lies below both Supertrends.

Velocity and momentum signals:

Measures RRG “velocity” — the speed of movement across the RS-Ratio/RS-Momentum plane.

Flags unusually strong rotations (high velocity) with a diamond marker when momentum accelerates.

Statistical bands & entry modes:

Standard-deviation bands on RS-Ratio (±2σ by default) can be used for mean-reversion entries if you select STDDEV mode instead of QUADRANT.

Shows fast RS moving average (9-period) as a smoother for momentum confirmation.

Custom time markers:

You can define a specific date (day, month, year) to analyze RRG values at that time and display the difference in bar count since that point.

Visualization:

Plots RS-Ratio (green) and RS-Momentum (blue) with a 100 baseline.

Benchmark and stock closing prices appear in the status line.

Chart background colors shift to reflect RRG quadrant and trend direction.

Usage:
Ideal for relative strength rotation analysis or as a systematic entry trigger in momentum-based strategies. It helps confirm trend continuation or reversals based on both relative momentum and technical trend strength.

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.