INVITE-ONLY SCRIPT

Universal Valuation Model [MarktQuant]

121
The "Valuation Model Universal" is a versatile technical analysis tool designed to assess an asset's valuation by combining multiple financial and momentum indicators into a unified z-score framework. It evaluates metrics such as price, Relative Strength Index (RSI), Rate of Change (RoC), Bollinger Band Percentage (BB%), Sharpe Ratio, Sortino Ratio, Omega Ratio, Money Flow Index (MFI), Commodity Channel Index (CCI), and a custom Crosby Ratio. These are normalized into z-scores and averaged to provide a comprehensive valuation signal, helping traders identify overbought or oversold conditions.

The indicator offers a color-coded table, optional candlestick bar coloring, and plotted z-score lines, with extensive customization options to adapt to different assets and timeframes. It also includes alert conditions for extreme undervaluation or overvaluation, making it suitable for both manual trading and automated strategies.

Key Features


Multi-Metric Z-Score Calculation:

  • Analyzes up to 10 indicators, including price, RSI, RoC, BB%, Sharpe Ratio, Sortino Ratio, Omega Ratio, MFI, CCI, and Crosby Ratio.
  • Normalizes each metric into a z-score, measuring how many standard deviations it deviates from its historical mean, based on a user-defined lookback period (default: 250 bars).
  • Allows users to enable or disable individual metrics for flexibility.
  • Average Z-Score (Z AVG):
  • Combines the selected z-scores into a single average value, adjusted for the number of active metrics.
  • Applies optional exponential moving average (EMA) smoothing to refine the signal (default length: 1).


Visualization Options:
  • Table Display: Presents a table in the middle-right of the chart, showing each metric’s label and its z-score.
  • Includes the average z-score and a valuation message with dynamic coloring.
  • Bar Coloring: Optionally colors candlesticks based on the average z-score, shifting from green to red across a -2 to 2 range.
  • Plots: Allows plotting of individual z-scores and the smoothed average, each with distinct gradient colors.
  • Labels: Optionally displays metric names next to their plotted values on the last bar.
  • Highlights the background with a light green shade for buy conditions or a light red shade for sell conditions.


Valuation Levels:
Categorizes the average z-score into seven valuation zones with descriptive messages:
≤ -2: "Strongly Undervalued" with green indicators.
< -1.5: "Moderately Undervalued" with a green indicator.
< -0.5: "Slightly Undervalued" with green and yellow indicators.
< 0: "Fairly Valued" with yellow and orange indicators.
< 0.5: "Slightly Overvalued" with red and orange indicators.
< 1.5: "Moderately Overvalued" with a red indicator.
< 2: "Strongly Overvalued" with double red indicators.


Alert Conditions:

Triggers alerts when the z-score crosses user-defined thresholds:
  • Buy Area: Below the oversold threshold (default: -1.8).
  • Sell Area: Above the overbought threshold (default: 1.8).


Inputs:
  • Length: Sets the lookback period for all calculations (default: 250 bars).
  • Source: Defines the price source for analysis (default: close price).
  • Visual Settings:Toggle for showing the table (default: enabled).
  • Option to enable candlestick coloring (default: enabled).
  • Choice to display plot labels (default: disabled).


Valuation Settings:
  • Oversold Z-Score: Threshold for buy alerts (default: -1.8).
  • Overbought Z-Score: Threshold for sell alerts (default: 1.8).
  • Include: Checkboxes to include or exclude each metric in the calculation.
  • Plots: Options to plot individual z-scores and the average z-score.
  • Z-Score Smoothing: Adjusts the EMA length for smoothing the average z-score (default: 1).


Indicator Calculations
  • Z-Score: Measures how far each metric deviates from its historical average in terms of standard deviations, using the specified lookback period.
  • A widely-used momentum oscillator that measures the speed and magnitude of recent price changes to identify overbought or oversold conditions.
  • Sharpe, Sortino, Omega Ratios: Calculated from return data and normalized into z-scores.
  • Crosby Ratio: A custom metric blending momentum and volatility, derived from price movement relative to the Average True Range (ATR) and smoothed with Heikin-Ashi techniques.
  • Average Z-Score: Sums the selected z-scores and divides by the number of active metrics, excluding unavailable values.
  • CCI (Commodity Channel Index): A momentum oscillator that evaluates price deviation from its statistical mean, helping identify overbought and oversold conditions relative to recent price levels.
  • MFI (Money Flow Index): A volume-weighted momentum indicator that uses price and volume data to detect buying and selling pressure, often used to anticipate trend reversals.


Usage
Chart Setup: Apply to any asset or timeframe. It can overlay candlestick coloring if enabled, while z-score plots appear in a separate panel.
Interpretation: Use the average z-score and table to gauge overall valuation. Plotted lines offer detailed insights into individual metrics.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.