1. Indicator Setup The script is a custom Pine Script indicator designed for use in TradingView. The indicator is named "Multi-Feature Trading Indicator", and it overlays its outputs on the price chart. The script allows for customization through inputs, where you can choose which features to show on the chart, such as Relative Volume (RVOL), Liquidity, VCP patterns, Monthly Gains, New Highs, EMA Alerts, and more. 2. Inputs The script allows users to toggle on/off several features, such as:
Relative Volume (RVOL) Liquidity Volume and Price Contraction (VCP) Monthly Gains NR4/NR7 Patterns ADR (Average Daily Range) and Up/Down Volume Ratio New Highs Significant Volume Events Pocket Pivots EMA Alerts RS Score (the new feature added) 3. Feature Calculations Relative Volume (RVOL) RVOL is calculated by dividing the current volume by the 50-period simple moving average (SMA) of volume. If RVOL is enabled, it is plotted as a line on the chart. Liquidity Liquidity is calculated by multiplying the closing price by the 50-period SMA of volume. A label is displayed showing the liquidity, and it's formatted in millions (if applicable). Volume and Price Contraction (VCP) VCP identifies contraction in both price (narrowing of the price range) and volume (declining volume). If the price range (high - low) and volume are both below their 50-period averages (within a given threshold), a triangle is plotted below the bar. Monthly Gains This section calculates percentage gains over the last 1-month and 3-month periods, comparing the current close with the previous month's/quarter's close. A label is shown on the chart indicating the percentage gains for both the 1-month and 3-month periods. NR4/NR7 Patterns The script identifies NR4 (narrowest range in the last 4 bars) and NR7 (narrowest range in the last 7 bars) patterns. Inside bars (bars where the high is lower than the previous bar’s high and the low is higher than the previous bar’s low) are also detected. Different shapes (circle, diamond) are plotted above or below the bars to indicate these patterns. Average Daily Range (ADR) and Up/Down Volume Ratio ADR is calculated as the difference between the highest and lowest prices over the last 14 bars, divided by the close price and multiplied by 100 to get the percentage. The Up/Down Volume Ratio is calculated by summing the volume of bars where the price closed up (bullish) and down (bearish) over the last 14 bars. New Highs The script identifies new highs on different timeframes (52-week high, 3-month high, and 6-month high). Triangles are plotted above the bars to mark these new highs, and labels are included to display the timeframe of the new high. Significant Volume Events Highest Ever Volume, Highest Year Volume, and Highest Quarter Volume are identified and plotted using labels above the bars. Pocket Pivots Pocket Pivots occur when the current bar’s volume is greater than the lowest volume over the last 10 bars for a down bar (a bar where the close is lower than the previous close). A label is plotted below the bar when a Pocket Pivot is detected. EMA Alerts EMA Alerts are generated based on whether the price is above any of the following EMAs: 10-period, 20-period, 50-period, or 200-period. A triangle is plotted above the bar if the price is above one of these EMAs. 4. RS Score Calculation RS Score is calculated based on the relative performance over different periods: 3 months, 6 months, 9 months, and 12 months. The formula for each score is: 𝑟 𝑠 _ 𝑠 𝑐 𝑜 𝑟 𝑒 = current close − lowest low over the period lowest low over the period × 100 rs_score= lowest low over the period current close−lowest low over the period ×100 Each score (3-month, 6-month, 9-month, 12-month) is then weighted: 3-month score × 0.4 6-month score × 0.2 9-month score × 0.2 12-month score × 0.2 The final RS Score is the weighted sum of these individual scores, scaled by 100. The RS Score is then displayed as a label on the chart, showing the combined relative strength score based on the calculated gains over the different periods. 5. Visual Representation For each of the features mentioned, shapes (triangles, circles, diamonds, labels, etc.) are plotted on the chart to visually represent specific patterns, volume events, price movements, or technical conditions. Labels are used to display values like liquidity, ADR, new highs, and RS Score. Summary This Pine Script indicator provides a wide range of technical analysis tools, including: