OPEN-SOURCE SCRIPT
Mis à jour RKB_MechTrade

The RKB MechTrade Momentm indicator is a comprehensive, all-in-one dashboard designed for Momentum and swing traders and investors. Upgraded to the latest Pine Script™ v6, it consolidates relative strength, volume analysis, trend momentum, and price-action proximity into a single, non-intrusive on-chart table.
Here is a breakdown of the core features and how to use them:
1. 52-Week High & Customizable Pullback Bands
The indicator plots the 52-week highest high directly on your chart, serving as a primary benchmark for resistance and breakouts.
Dynamic Pullback Bands: Below the 52-week high, it plots two customizable percentage bands (defaulting to 10% and 23% below the high).
Use Case: These bands help visualize structural support zones and identify textbook pullback setups (like VCPs or flag patterns) relative to the yearly high.
2. Z-Score of Returns (ZOR)
The ZOR module is the engine of the script's relative strength analysis.
How it works: It measures the performance of the base asset against a comparative benchmark (defaults to NSE:NIFTY) over multiple weighted timeframes (63, 126, 189, and 252 days).
The Score: It normalizes these weighted returns into a clean Z-Score. A score above 60 is highlighted in blue, indicating strong relative momentum and market outperformance. Values below 60 are flagged in red.
Note: To ensure data accuracy, ZOR is explicitly calculated and displayed only on the Daily timeframe.
3. Price Proximity Metrics (DTH & DTE)
Knowing how extended a stock is can prevent buying at the top or shorting at the bottom.
Distance to High (DTH): Calculates the exact percentage gap between the current closing price and the 52-week high. If the stock is breaking out, it clearly states "At or Above 52W High".
Distance to EMA (DTE): Measures the percentage deviation from a user-defined EMA (default 21-period). This is an excellent metric for spotting mean-reversion opportunities or avoiding heavily overextended entries.
4. Institutional Volume & Traded Value (Turnover)
Rather than just looking at raw volume bars, this script calculates the actual capital flowing into the asset.
Traded Value in Crores: It calculates the traded turnover (Volume × Close Price) and adapts automatically to your chart. On a Daily chart, it shows daily turnover; on a Weekly chart, it accumulates the weekly turnover.
Color-Coded Liquidity: The Traded Value cell changes color based on strict liquidity thresholds:
Volume Context: It also compares current volume to a long-term average (default 500 periods), tagging the session as "Trade" (active) or "Low" (quiet).
5. Trend Angle & Price Velocity
MA Angle (∠): Calculates the geometric slope/angle of a chosen Moving Average (defaults to a 20-period EMA). A positive angle indicates a clear uptrend, while a negative angle warns of a downtrend.
Velocity: Analyzes the current bar's High-Low range against a 14-period average. If the current range is wider than the average, it tags the market as "Fast" (expansion/volatility). If narrower, it tags it as "Slow" (contraction/consolidation).
6. Interactive UI & Tooltips
Clean Table: All data is neatly organized in a vertical dashboard anchored to the bottom-right of the screen (fully customizable in the settings).
Hover-to-Learn: Built using Pine Script™ v6 features, every single cell in the dashboard includes an interactive tooltip. Users can simply hover their mouse over any metric (like ZOR or Velocity) to instantly read a description of what it means and how it is calculated.
Here is a breakdown of the core features and how to use them:
1. 52-Week High & Customizable Pullback Bands
The indicator plots the 52-week highest high directly on your chart, serving as a primary benchmark for resistance and breakouts.
Dynamic Pullback Bands: Below the 52-week high, it plots two customizable percentage bands (defaulting to 10% and 23% below the high).
Use Case: These bands help visualize structural support zones and identify textbook pullback setups (like VCPs or flag patterns) relative to the yearly high.
2. Z-Score of Returns (ZOR)
The ZOR module is the engine of the script's relative strength analysis.
How it works: It measures the performance of the base asset against a comparative benchmark (defaults to NSE:NIFTY) over multiple weighted timeframes (63, 126, 189, and 252 days).
The Score: It normalizes these weighted returns into a clean Z-Score. A score above 60 is highlighted in blue, indicating strong relative momentum and market outperformance. Values below 60 are flagged in red.
Note: To ensure data accuracy, ZOR is explicitly calculated and displayed only on the Daily timeframe.
3. Price Proximity Metrics (DTH & DTE)
Knowing how extended a stock is can prevent buying at the top or shorting at the bottom.
Distance to High (DTH): Calculates the exact percentage gap between the current closing price and the 52-week high. If the stock is breaking out, it clearly states "At or Above 52W High".
Distance to EMA (DTE): Measures the percentage deviation from a user-defined EMA (default 21-period). This is an excellent metric for spotting mean-reversion opportunities or avoiding heavily overextended entries.
4. Institutional Volume & Traded Value (Turnover)
Rather than just looking at raw volume bars, this script calculates the actual capital flowing into the asset.
Traded Value in Crores: It calculates the traded turnover (Volume × Close Price) and adapts automatically to your chart. On a Daily chart, it shows daily turnover; on a Weekly chart, it accumulates the weekly turnover.
Color-Coded Liquidity: The Traded Value cell changes color based on strict liquidity thresholds:
- Red: Less than 5 Cr (Low Liquidity)
- Amber: 5 Cr to 50 Cr (Moderate Liquidity)
- Green: Greater than 50 Cr (High Institutional Liquidity)
Volume Context: It also compares current volume to a long-term average (default 500 periods), tagging the session as "Trade" (active) or "Low" (quiet).
5. Trend Angle & Price Velocity
MA Angle (∠): Calculates the geometric slope/angle of a chosen Moving Average (defaults to a 20-period EMA). A positive angle indicates a clear uptrend, while a negative angle warns of a downtrend.
Velocity: Analyzes the current bar's High-Low range against a 14-period average. If the current range is wider than the average, it tags the market as "Fast" (expansion/volatility). If narrower, it tags it as "Slow" (contraction/consolidation).
6. Interactive UI & Tooltips
Clean Table: All data is neatly organized in a vertical dashboard anchored to the bottom-right of the screen (fully customizable in the settings).
Hover-to-Learn: Built using Pine Script™ v6 features, every single cell in the dashboard includes an interactive tooltip. Users can simply hover their mouse over any metric (like ZOR or Velocity) to instantly read a description of what it means and how it is calculated.
Notes de version
RKB_MechTrade v2: Enhanced Momentum & Fundamental DashboardThis major update to the RKB_MechTrade indicator bridges the gap between technical momentum and fundamental context. By bringing vital asset data directly to your charts, this tool allows for a much more comprehensive view of relative strength setups without needing to switch tabs.
What's New in v2:
Fundamental Data Integration: Instantly view the asset's Sector, Industry, Market Cap Category (Large/Mid/Small), and exact Market Cap Value (formatted in ₹ Crores) alongside your technical metrics.
Fully Customizable Dynamic UI: Your chart, your rules. A new dedicated "Display Settings" menu allows you to toggle every single data point on or off. The data table automatically resizes and snaps together based on your selections to keep your workspace clutter-free.
Upgraded 'Distance to EMA' Visuals: Instantly gauge price extension and risk with new color-coded alerts for the Distance to EMA (DTE) metric:
🟢 0% to +10%: Healthy trend proximity.
🟠 +10% to +20%: Caution (Extended).
🔴 > +20% or Negative: Highly overextended or broken trend.
Core Features Retained:
Z-Score of Returns (ZOR): Continue tracking relative strength against a comparative base index to find market leaders.
Volume & Velocity Context: Quick-read text indicating if the current volume is "Trade" or "Low" and if price action velocity is "Fast" or "Slow" compared to historical averages.
52-Week High Breakout Bands: Fully customizable upper and lower percentage bands to track proximity to yearly highs.
Optimized for momentum traders who need to quickly screen technical extension metrics against market cap tiers.
Notes de version
version 2Notes de version
RKB_MechTrade v3: Advanced Risk & Trend Quality DashboardTrue momentum trading isn’t just about finding the strongest assets—it’s about understanding the exact risk profile of the trend before allocating capital. Version 3 of the RKB_MechTrade indicator transforms the dynamic UI into a comprehensive quantitative dashboard by integrating a brand-new Risk & Trend Quality Module.
By evaluating annualized volatility, benchmark correlation, and normalized trend strength, this update allows system-driven traders to instantly qualify their setups without leaving the chart.
🔥 What's New in v3:
1. 1-Year Beta (Benchmark Correlation)
Automatically calculates the stock's 1-Year Beta relative to the broader market index. Know immediately if your relative strength is coming from defensive outperformance or highly leveraged market sensitivity.
🟢 Defensive (<0.8): Lower market correlation.
🔘 Market-like (0.8 - 1.2): Moves with the broader market.
🔵 Aggressive (1.2 - 1.5): Amplified market moves.
🔴 High-Beta Momentum (>1.5): Highly sensitive, high-octane momentum.
2. 1-Week Volatility Tracker
Raw momentum is dangerous without context. v3 calculates logarithmic standard deviation and scales it into a professional 1-Week Volatility metric, providing a normalized view of the asset's week-over-week risk trajectory. Color-coded thresholds instantly warn you when a stock crosses from "Normal Momentum" into "High-Risk" territory (>4%).
3. Normalized ATR%
A raw Average True Range (ATR) value is useless when scanning across assets of different prices. We’ve normalized the 14-period ATR into a pure percentage (ATR / Close). This allows for seamless cross-asset screening, letting you instantly flag low-volatility bases (<2%) versus highly erratic price action (>5%).
4. ADX Trend Validation
Strong Z-Score of Returns (ZOR) needs an underlying trend to sustain it. The integrated 14-period ADX metric color-codes the structural health of the move:
⚪ Weak Trend (<20): Consolidation or chop.
🟡 Emerging Trend (20-25): Early-stage momentum.
🟢 Strong / Very Strong Trend (>25): Confirmed directional velocity.
Notes de version
-Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.