Williams Variable Accumulation Distribution Trading Indicator

Article

Learn how to implement the Williams Variable Accumulation Distribution (WVAD) in your fintech software applications to analyze buying and selling pressures.
Soroush Sohrabian

Ahmad Omid

Data Science Developer

LinkedIn icon
williams-variable-accumulation-distribution-Cover

Introduction

The Williams Variable Accumulation Distribution (WVAD) is a technical indicator designed to analyze buying and selling pressures within financial markets. Developed by Larry Williams, this indicator integrates price and volume data to offer insights into market sentiment.

By calculating the relationship between the open-close range and the high-low range, WVAD provides traders with actionable information about potential market trends and reversals.

Historically, technical analysts have relied on indicators like accumulation/distribution lines to gauge market activity. The Williams Variable Accumulation Distribution indicator refines this approach by incorporating nuances of volume dynamics.

This tool has gained popularity among traders for its ability to signal momentum shifts and confirm price trends, making it a valuable addition to any trader’s analytical toolkit.

The Williams Variable Accumulation Distribution is primarily used to detect buying or selling pressure in the market. It helps traders assess whether a stock or asset is under accumulation (buyers are dominating) or distribution (sellers are dominating). By doing so, it offers guidance on entry and exit points and helps identify potential trend reversals.

Traders often combine WVAD with other indicators or strategies to enhance its predictive power.

Formula

The Williams Variable Accumulation Distribution is calculated using the following formula:

williams-variable-accumulation-distribution-formula

Where:

  • Close: Closing price of the period.
  • Open: Opening price of the period.
  • High: Highest price of the period.
  • Low: Lowest price of the period.
  • Volume: The number of shares or contracts traded during the period.

Interpretation

The formula measures the relative position of the closing price within the range of the high and low, adjusted for the opening price. A positive value indicates that the closing price is closer to the high, suggesting buying pressure. Conversely, a negative value suggests that the closing price is closer to the low, indicating selling pressure. By summing these values over time, traders can observe cumulative buying or selling trends.

Example 1

Consider a stock with the following data for a day:

  • Open: $100
  • Close: $110
  • High: $115
  • Low: $95
  • Volume: 1,000

Using the WVAD formula:

williams-variable-accumulation-distribution-formula-example

A positive WVAD of 500 indicates buying pressure, suggesting that demand is driving the price upward.

Example 2

Now consider another stock:

  • Open: $200
  • Close: $190
  • High: $210
  • Low: $185

Volume: 2,000

williams-variable-accumulation-distribution-formula-example2

A negative WVAD of -800 indicates selling pressure, signaling that supply is outweighing demand.

How to Create the Technical Indicator Using LC JS Trader

Step 1: Get LightningChart JS Trader

To begin, you’ll need access to LightningChart JS Trader. This library provides the tools necessary to create advanced technical indicators, including the Williams Variable Accumulation Distribution Indicator. Visit the LightningChart JS Trader page to download the required components and review the documentation.

Step 2: Review the Interactive Example

LightningChart JS Trader includes interactive examples that demonstrate how to create custom technical indicators. Start by reviewing the documentation, focusing on how to integrate the Williams Variable Accumulation Distribution Indicator into your chart setup. The interactive examples will guide you through the process of setting up the WVAD Indicator, from importing the necessary modules to modify the chart settings.

Step 3: Code Explanation

In this step, we will break down the code that creates the chart with the Williams Variable Accumulation Distribution Indicator, as shown in the image, using LightningChart JS Trader. The code demonstrates how to initialize a trading chart, apply the WVAD Indicator, and customize its appearance.

williams-variable-accumulation-distribution-chart-example

Here’s a detailed breakdown of each section:

A. Importing the Required Libraries:

   const lcjsTrader = require('@arction/lcjs-trader')
   const lcjs = require('@arction/lcjs')
   const { Themes } = lcjs
  • lcjsTrader: This library provides access to the LightningChart JS Trader functionalities, allowing you to create advanced financial charts.
  • lcjs: The main LightningChart JS library, used for general charting functionality.
  • Themes: A property within lcjs that provides access to pre-built themes. In this case, we are using the darkGold theme to style the chart.

B. Initializing the Trading Chart:

   lcjsTrader.trader(TRADER_LICENSE).then(async (trader) => {
    // Create a trading chart.
    const tradingChart = trader.tradingChart({ loadFromStorage: false, colorTheme: Themes.darkGold })
  • trader(TRADER_LICENSE): Initializes the LightningChart JS Trader with the provided license key (TRADER_LICENSE). This is required to access the charting functionalities for financial data.

Note you can request a LightningChart JS Trader trial license, which is free.

  • tradingChart(): This function creates a trading chart with certain options.
  • loadFromStorage: false: This disables the loading of previously stored chart data from local storage, ensuring a fresh chart setup.
  • colorTheme: Themes.darkGold: This applies the darkGold theme to the chart, which influences the background color, gridlines, and other visual elements.

C. Adding and Customizing the Indicator

  // Add Williams Variable Accumulation Distribution indicator
  const wvad = tradingChart.indicators().addWilliamsVariableAccumulationDistribution()
  wvad.setPeriodCount(20)
  wvad.setMovingAverageType(8)
  wvad.setLineColor('#FF3333')
  wvad.setLineWidth(3)
  • addWilliamsVariableAccumulationDistribution(): WVAD calculates the relationship between the open-close range and the high-low range, which gives information about buying and selling pressures.
  • setPeriodCount(20): Sets the number of time periods (n) used to calculate the indicator.
  • **wvad.setMovingAverageType(8): This method sets the type of Moving Average used to calculate the short and long averages. In this case, 8 represents the Weighted Moving Average (WMA).
  • setLineColor('# FF3333'): Changes the line color of the indicator to red.
  • wvad.setLineWidth(3): Sets the line thickness of WVAD indicator to 3 pixels. This makes the line more prominent and easier to observe during analysis.

D. Loading Data from a CSV File

    // Reading data from a file.
    await fetch(`${document.head.baseURI}examples/assets/0000/Alphabet Inc (GOOGL).csv`).then((res) => res.text()).then((text) => {
        tradingChart.readCsvString(text, 'Alphabet Inc (GOOGL)')
    })
  • fetch(): This function retrieves a CSV file containing historical data for Alphabet Inc. (GOOGL). The CSV file includes pricing information for the company’s stock, which is plotted on the chart.
  • readCsvString(): This function reads the CSV data and interprets it as pricing data for Alphabet Inc. The second argument (‘Alphabet Inc (GOOGL)’) sets the label for the chart, as seen at the top of the chart image.

E. Setting the Currency for the Chart

    tradingChart.setCurrency('USD')
   })
  • setCurrency('USD'): This sets the currency of the chart to USD, ensuring that the pricing data is interpreted and displayed in US dollars.

** Enumeration of Moving Average Types in LC JS Trader:

  • Exponential Moving Average (EMA): 0
  • None: 1 (No moving average applied)
  • Simple Moving Average (SMA): 2
  • Time Series Moving Average (TSMA): 3
  • Triangular Moving Average (TMA): 4
  • Variable Moving Average (VMA): 5
  • Variable Index Dynamic Average (VIDYA): 6
  • Volume Weighted Moving Average (VWMA): 7
  • Weighted Moving Average (WMA): 8
  • Welles Wilder’s Smoothing (WWS): 9

Advantages and Limitations of the Indicator

The Williams Variable Accumulation Distribution (WVAD) trading indicator offers several advantages, making it a valuable tool for market analysis. One of its primary strengths lies in its sensitivity to volume, which allows traders to gauge market dynamics effectively.

By incorporating volume data, WVAD provides insights into the underlying buying and selling pressures, enabling traders to identify potential trend shifts and momentum changes. Another advantage is its ability to deliver directional insights by highlighting whether an asset is under accumulation (buying pressure) or distribution (selling pressure).

Additionally, WVAD is versatile, suitable for use across various timeframes, which makes it appealing to both day traders and long-term investors. Its compatibility with other indicators further enhances its utility, as it can confirm signals from other technical tools, reducing the likelihood of errors in decision-making.

Despite its strengths, WVAD is not without limitations. One significant drawback is its susceptibility to false signals, particularly during periods of high market volatility or sudden price spikes. These anomalies can lead to misleading WVAD values, which might prompt incorrect trading decisions.

Moreover, interpreting Williams Variable Accumulation Distribution indicator readings can be complex, as traders must consider broader market contexts and avoid over-reliance on the indicator alone. Another challenge is its dependence on accurate volume data, which might not always be available in certain markets, such as forex, where trading volume is not directly recorded. Understanding these limitations is crucial for traders to use WVAD effectively and minimize risks.

Conclusion

The Williams Variable Accumulation Distribution (WVAD) trading indicator is a powerful tool for analyzing market sentiment by examining the relationship between price and volume. It provides insights into buying and selling pressures, helping traders make more informed decisions about potential trend shifts and entry or exit points.

By understanding the WVAD formula and its practical applications, traders can enhance their ability to identify accumulation and distribution phases, boosting their overall strategy.

An essential aspect of effectively implementing WVAD in your trading workflow is leveraging a robust charting library like LightningChart JS Trader. LightningChart offers high-performance, interactive charting capabilities, making it easier to visualize WVAD and other technical indicators in real-time. 

Continue learning with LightningChart

LightningChart Python Trader v1.2

LightningChart Python Trader v1.2

Announcing LightningChart Python Trader v1.2 New Product Features LightningChart Python Trader V1.2 introduces a couple of new technical indicators and drawing tools. Furthermore, several user-requested features and improvements have been added to the library.  New...