Williams Accumulation Distribution on Price

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #227133 quote
    Mary
    Participant
    Average

    Hello, is there any way to overlay Williams Accumulation Distribution Indicator on actual price instead of below it? ProRealTime does not seem to allow it to overlay it on Price instead of plotting it below. Is there a code to do it? Thank you.

    williams-accu-dist.png williams-accu-dist.png
    #227150 quote
    Nicolas
    Keymaster
    Master

    Default indicator of the platform can’t be applied on price when they are not intended to be used this way. Particulary for Williams Accumulation Distribution, which doesnt share the same scale (volume) vs price ..

    A workaround is to create a normalized indicator:

    // Williams Accumulation Distribution Calculation
    WAD = WilliamsAccumDistr
    
    // Find the highest and lowest prices on the visible chart
    visiblebars = max(1,barindex)
    HighestPrice = highest[visiblebars](high)
    LowestPrice = lowest[visiblebars](low)
    
    // Calculate the range of the price
    PriceRange = HighestPrice - LowestPrice
    
    // Find the highest and lowest values of WAD for normalization
    HighestWAD = highest[visiblebars](WAD)
    LowestWAD = lowest[visiblebars](WAD)
    
    // Calculate the range of WAD
    WADRange = HighestWAD - LowestWAD
    
    // Normalize WAD values to fit the price scale
    NormalizedWAD = (WAD - LowestWAD) / WADRange * PriceRange + LowestPrice
    
    // Plotting the Normalized WAD on the price chart
    return NormalizedWAD as "Normalized WAD"

    This code snippet normalizes the Williams Accumulation Distribution Indicator values to the scale of the highest to lowest prices on the visible part of the chart, making it possible to overlay it directly on the price chart. The visiblebars (all barindex loaded) variable  is used to dynamically adjust to the visible part of the chart, ensuring that the normalization is relevant to the current view.

    Keep in mind that the effectiveness of this normalization approach can vary depending on the volatility and the range of the Williams Accumulation Distribution values compared to the price range. This method is meant to visually assist in analysis rather than serve as a direct trading signal.

    #227208 quote
    Mary
    Participant
    Average

    Thank you, but I have another question. Is there any way to plot this Normalized WAD  right over the price instead of running it parallel and at a distance? I would love to actually overlay straight on Price rather then run it parallel. Please see picture below to see how it appears now and Normalized WAD is a blue line.

    NORMALIZED-WAD.png NORMALIZED-WAD.png
    #227225 quote
    Nicolas
    Keymaster
    Master

    Change the line:

    visiblebars = max(1,barindex)

    with

    visiblebars = 100

    100 is the period of normalization, change it as desired to get the curve to a close distance of price rather than using the whole asset history.

    Mary thanked this post
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Williams Accumulation Distribution on Price


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Mary @mila Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Nicolas
2 years, 1 month ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 01/31/2024
Status: Active
Attachments: 2 files
Logo Logo
Loading...