OPEN-SOURCE SCRIPT

Larry Williams Valuation Index [tradeviZion]

Larry Williams Valuation Index [tradeviZion]

Welcome to the Larry Williams Valuation Index by tradeviZion! This script is an interpretation of Larry Williams' famous WillVal (Valuation) Index, originally developed in 1990 to help traders determine whether a market or asset is overvalued or undervalued. We've extended it to support multiple securities and offer alerts for different valuation levels, helping you make more informed trading decisions.

What is the Valuation Index?

The Valuation Index measures how a security's current price compares to its historical price action. It helps identify whether the security is overvalued (priced too high), undervalued (priced too low), or in a normal range.

This version supports multiple securities and uses valuation parameters to help you assess the relative valuation of three securities simultaneously. It can help you determine the best times to enter (buy) or exit (sell) the market.

Key Features
  • Multi-Security Analysis: Analyze up to three securities simultaneously to get a broader view of market conditions.
  • Valuation Levels: Automatically calculate overvaluation and undervaluation levels or set manual levels for consistent analysis.
  • Custom Alerts: Create custom alerts when securities move between overvalued, undervalued, or normal ranges.
  • Customizable Table Display: Display a table with valuation values and their status on the chart.


Getting Started

Step 1: Adding the Script to Your Chart
First, add the Larry Williams Valuation Index script to your chart on TradingView. The script is designed to work with any timeframe, but for best results, use weekly or daily timeframes for a longer-term perspective.

Step 2: Configuring Securities
  • The script allows you to analyze up to three different securities:
  • Security 1 (Default: DXY)
  • Security 2 (Default: GC1!)
  • Security 3 (Default: ZB1!)
  • You can enable or disable each security individually.
  • Custom Timeframe Option: You have the option to select a custom timeframe for analysis. This allows you to see whether the security is overvalued or undervalued in lower or higher timeframes. Note that this feature is experimental and has not been extensively tested. Larry Williams originally used the weekly timeframe to determine if a stock was overvalued or undervalued. By default, the indicator compares the current price with the security based on the selected timeframe, except if you choose to use a custom timeframe.
  • Pro Tip: New users can start with the default securities to understand the concept before using other assets.


Step 3: Valuation Index Settings
  • Short EMA Length: This is the short-term average used for calculations. A lower value makes it more responsive to recent price changes.
  • Long EMA Length: This is the long-term average, used to smooth the valuation over time.
  • Valuation Length (Default: 156): Represents approximately three years of daily bars (as recommended by Larry Williams).


How is the Valuation Index Calculated?
The valuation calculation is done using a method called WVI (WillVal Index), which compares the current price of a security to the price of another correlated security. Here’s a step-by-step explanation:

1. Data Collection: The script takes the closing price of the security you are analyzing and the closing price of the correlated security.
2. Ratio Calculation: The ratio of the two prices is calculated:
  • Price Ratio = (Price of your security) / (Price of correlated security) * 100.
  • This ratio helps determine how expensive or cheap your security is compared to the correlated one.


3. Exponential Moving Averages (EMAs): The price ratio is used to calculate short-term and long-term EMAs (Exponential Moving Averages). EMAs are used to create smooth lines that represent the average price of a security over a specific period of time, with more weight given to recent data. By calculating both short-term and long-term EMAs, we can identify the trend direction and how the security is performing compared to its historical averages.

4. Valuation Index Calculation:
  • The Valuation Index is calculated as the difference between the short-term EMA and the long-term EMA. This difference helps to determine if the security is currently overvalued or undervalued:
  • A positive value indicates that the price is above its longer-term trend, suggesting potential overvaluation.
  • A negative value indicates that the price is below its longer-term trend, suggesting potential undervaluation.


5. Normalization:
  • To make the valuation easier to interpret, the calculated valuation index is then normalized using the highest and lowest values over the selected valuation length (e.g., 156 bars).
  • This normalization process converts the index into a percentage between 0 and 100, where higher values indicate overvaluation and lower values indicate undervaluation.


Step 4: Understanding Valuation Levels
  • The valuation levels indicate whether a security is currently undervalued, overvalued, or in a normal range.
  • Manual Levels: You can manually set the overvaluation and undervaluation thresholds (default is 85 for overvalued and 15 for undervalued).
  • Auto Levels: The script can automatically calculate these levels based on recent price action, allowing you to adapt to changing market conditions.

Auto Levels Calculation Explained:
  • The Auto Levels are calculated by taking the average of the valuation indices for all three securities (e.g., index1, index2, and index3).
  • The script then looks at the highest and lowest values of this average over a selected number of recent bars (e.g., 50 bars).
  • The overvaluation level is determined by taking the highest value and multiplying it by a multiplier (e.g., 5). Similarly, the undervaluation level is calculated using the lowest value and the multiplier.
  • These dynamic levels adjust according to recent price action, providing an adaptive approach to identifying overvalued and undervalued conditions.


Step 5: How to Use the Script to Make Trading Decisions
For new users, here's a step-by-step trading strategy you can use with the Valuation Index:
snapshot
1. Identify Undervalued Opportunities
  • When two or more securities are in the undervalued range (below 15 for manual or below automatically calculated undervalue levels), wait for at least two of these securities to turn from undervalued to normal.
  • This transition indicates a potential buy opportunity.


2. Buying Signal
  • When at least two securities transition from undervalued to normal, you can consider buying the asset.
  • This indicates that the market may be recovering from undervalued conditions and could be moving into a growth phase.


3. Selling Signal
  • Exit when the price high closes below the EMA 21 (21-day exponential moving average).
  • Alternatively, if the valuation index reaches overvalued levels (above 85 manually or auto-calculated), wait for it to drop back to normal. This can be another point to exit the trade.
  • You can also use any other sell condition based on your risk management strategy.


Alerts for Valuation Levels
The script includes alerts to notify you of changing market conditions:
snapshot
To activate these alerts, follow these steps, referring to the provided screenshot with detailed steps:
1. Enable Alerts: Click on the settings gear icon on the script title in your chart. In the settings menu, scroll to the section labeled Alerts Settings.
  • Enable Alerts by checking the Enable Alerts box.
  • Set the Required Securities for Alert (default is 2 securities).
  • Choose the Alert Frequency: Selecting Once Per Bar Close will trigger alerts only at the close of each bar, ensuring you receive confirmed signals rather than potentially noisy intermediate signals.


2. Select Alert Type: Choose the type of alert you want to activate, such as Alert on Overvalued, Alert on Undervalued, Alert on Over to Normal, or Alert on Under to Normal.

3. Save Settings: Click OK to save your alert settings.

4. Add Alert on Indicator: Click the "..." (More button) next to the indicator name on the chart and select "Add alert on tradeviZion - WillVal".

5. Create Alert: In the Create Alert window:
  • Set Condition to tradeviZion - WillVal.
  • Ensure Any alert() function call is selected.
  • Set the Alert Name and select your Expiration preferences.


6. Set Notification Preferences: Go to the Notifications tab and select how you want to receive notifications, such as via app notification, toast notification, email, or sound alert. Adjust these preferences to best suit your needs.

7. Click Create: Finally, click Create to activate the alert.

These alerts will help you stay informed about key market conditions and take action accordingly, ensuring you do not miss critical trading opportunities.

Understanding the Table Display
The script includes an interactive table on the chart to show the valuation status of each security:
  • Security: The name of the security being analyzed.
  • Value: The current valuation index value.
  • Status: Indicates whether the security is overvalued, undervalued, or in a normal range.
  • Color: Displays a color code for easy identification of status:
  • Red for overvalued.
  • Green for undervalued.
  • Other colors represent normal valuation levels.
  • Empowering Messages: Motivational messages are displayed to encourage disciplined trading. These messages will change periodically, helping keep a positive trading mindset.


Acknowledgment
This tool builds upon the foundational work of Larry Williams, who developed the WillVal (Valuation) Index concept. It also incorporates enhancements to extend multi-security analysis, valuation normalization, and advanced alerting features, providing a more versatile and powerful indicator. The Larry Williams Valuation Index [tradeviZion] helps traders make informed decisions by assessing overvalued and undervalued conditions for multiple securities simultaneously.

Note: Always practice proper risk management and thoroughly test the indicator to ensure it aligns with your trading strategy. Past performance is not indicative of future results.

Trade smarter with TradeVizion—unlock your trading potential today!
Bill Williams IndicatorsFundamental Analysislarrywiliamsmarketconditionsmultitimeframeanalysisoverbought-oversoldtradevizionTrend Analysisvaluationindexvolatilityindexwillval

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


TradeVizion™

Disclaimer