OPEN-SOURCE SCRIPT

WRAMA Channel (Weighted RSI ATR MA)

131
OVERVIEW
The WRAMA Channel (Weighted RSI ATR MA) is an advanced technical analysis tool designed to react more quickly to price movements compared to indicators using conventional moving averages. It combines the Relative Strength Index (RSI), Average True Range (ATR), and a weighted moving average, resulting in the WRAMA. This indicator forms a dynamic price channel based on a weighted average that incorporates both trend strength (via RSI) and market volatility (via ATR). It helps traders identify trends, potential reversals, and breakout signals, while offering broad customization options.

Key Features

WRAMA Price Channel:
Generates a dynamic channel around the weighted moving average (WRAMA), adapting to market volatility and momentum, similar to Bollinger Bands. Users are encouraged to adjust channel width and length according to their strategy.

The upper and lower channel bands are calculated based on a percentage deviation from the baseline line.

The channel fill color changes depending on the price's position relative to the baseline (green above, red below), with an optional gradient for better visualization.

Weighted Moving Average (WRAMA):
WRAMA is a custom weighted moving average (MA1), where closing prices are weighted based on RSI and ATR, allowing it to dynamically adapt to market conditions.

Baseline: The WRAMA line calculated over a user-defined period.

WRAMA Calculation:

RSI Weight: Based on RSI value. When RSI is in extreme zones (below the lower threshold or above the upper threshold), an extreme weight is applied. Otherwise, the weight is based on the squared RSI value divided by 100, raised to a power defined by the rsi_weight_factor.

ATR Weight: Based on the ATR-to-average-ATR ratio. If ATR exceeds a threshold (atr_threshold × avg_atr), an extreme weight is applied. Otherwise, the weight is based on the squared ratio of ATR to average ATR, raised to the power of the atr_weight_factor.

Combined Weight: RSI and ATR weights are combined using a rsi_atr_balance parameter. Final weight = RSI weight × balance + ATR weight × (1 - balance).

WRAMA Calculation: The closing price is multiplied by the combined weight. The result is averaged over the ma_length period and divided by the average of the weights, forming the WRAMA line. For current WRAMA (ma_length = 1), the calculation simplifies to a single weighted price.

Additional Moving Averages:
For additional confirmations, the indicator supports up to five moving averages (MA1–MA5) with various types (SMA, EMA, WMA, HMA, ALMA) and customizable periods.

All additional MAs are calculated based on WRAMA or its baseline, ensuring consistency and enabling deeper analysis within a unified methodology. MA trend directions can be tracked in a built-in signal table.

Trading Signals:
Breakout Signals: Breakouts above/below the channel are optionally marked with triangle shapes (green for bullish, red for bearish).

MA Signals: Price position relative to MAs or their slope generates bullish/bearish signals. These are optionally visualized with default triangles (green up, red down).

A signal table in the top-right corner summarizes the status of each moving average – bullish, bearish, or neutral.

Customization Options
Channel Settings:
MA Period: Length of the WRAMA baseline (default: 100).

Channel Deviation [%]: Percentage offset from the baseline for upper/lower bands (default: 1.5%).

RSI Settings:
RSI Period: Length of the RSI calculation (default: 14).

RSI Upper/Lower Threshold: Overbought/oversold levels (default: 70/30).

RSI Weight Factor: Influence of RSI on weighting (default: 2.0).

ATR Settings:
ATR Period: ATR calculation length (default: 14).

ATR Threshold: Volatility threshold as a multiple of average ATR (default: 1.5).

ATR Weight Factor: Influence of ATR on weighting (default: 2.0).

RSI & ATR Combined:
Extreme Weight: Weight applied in extreme RSI/ATR conditions (default: 3.0).

RSI/ATR Balance: Balance between RSI and ATR influence (default: 0.5).

Signal Settings:
Show Breakout Signals: Enable/disable breakout triangles.

Show MA Signals: Enable/disable MA-based signals.

MA Signal Source: Choose between current WRAMA or baseline.

MA Signal Analysis: Based on price position or slope.

Neutral Threshold [%]: Minimum distance from MA for signal neutrality (default: 0.5%).

Minimum MA Slope [%]: Minimum slope for trend direction signals (default: 0.01%).

Moving Averages (MA1–MA5):
Options to enable/disable, select type (SMA, EMA, WMA, HMA, ALMA), set period length, and choose color.

Style Settings:
Gradient Fill: Enable/disable gradient coloring within the channel.

Show Baseline: Enable/disable WRAMA baseline visibility.

Colors: Customize line, fill, and signal colors.

Use Cases
Trend Identification: The WRAMA channel highlights trend direction and potential reversal zones when price contacts the channel edges.

Breakout Signals: Channel breakouts may indicate trend shifts or momentum surges.

MA Analysis: The signal table provides a clear summary of market direction (bullish, bearish, or neutral) based on selected moving averages.

Trading Strategies: Suitable for trend-following, mean-reversion, and scalping strategies, depending on user preferences and settings.

Notes
The indicator offers a high degree of flexibility, making it adaptable to various trading styles, instruments, and timeframes.

It is recommended to adjust channel length and width to fit your trading strategy.

Backtesting settings on historical data is advised to optimize parameters for a specific strategy and market.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.