Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accumulation distribution formula larry william for stocks

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Accumulation distribution formula larry william for stocks

    hello..
    I'm reading an old book by Larry William that says:

    "In a concise form the equation is this: Close minus the opening, divided by high
    minus the low, times daily volume = net buying or selling volume for the day (net
    daily A/D figure).

    This is equated as :
    close-open
    -----------------
    high -low X total volume = net buying or selling pressure for the day."

    can you help me write this indicator?please

    thank you very much

    Simone

    #2
    Hello lion1980, thanks for your note.

    The first thing the script will need is a secondary daily series. This will let us get the daily volume. Use AddDataSeries() to add a daily series.

    After this, in BarsInProgress == 0, perform the calculation:

    Code:
    [I]protected override void OnStateChange()
            {
                if (State == State.SetDefaults)
                {
                    ...
                    AddPlot(Brushes.Red, "MyPlot");
                }
                else if (State == State.Configure)
                {
                    AddDataSeries(BarsPeriodType.Day, 1);
                }
            }
    
            protected override void OnBarUpdate()
            {
                if(CurrentBars[1] < 1 || CurrentBars[0] < 1)
                    return;
    
                if(BarsInProgress == 0)
                {
                    Value[0] = (Close[0] - Open[0])/((High[0] - Low[0])*Volumes[1][0]);
                }
    
            }[/I]

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    68 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    151 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    100 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    288 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X