Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accumulation Distribution %

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

  • koganam
    replied
    Originally posted by kzuschlag View Post
    After going back into the book the formula Bollinger lists is:
    10-day sum of [(close-open) / (high-low) * volume] / 10-day sum of volume.

    bolded is the part I think I forgot to mention. Thanks for your help koganam! I really appreciate it.
    kzuschlag, may we have some feedback on this one. Is the code what you expected? Have you had any funny problems running the indicator? Can we post it to the file sharing section?

    Leave a comment:


  • koganam
    replied
    Originally posted by kzuschlag View Post
    After going back into the book the formula Bollinger lists is:
    10-day sum of [(close-open) / (high-low) * volume] / 10-day sum of volume.

    bolded is the part I think I forgot to mention. Thanks for your help koganam! I really appreciate it.
    The attached is a direct coding of what you specified. It is just a quick-and-dirty piece of coding with no error-checking. See if it does what you want, after which I will decide if I even need to put any kind of error-checking or limit filter on the plot.
    Attached Files

    Leave a comment:


  • kzuschlag
    replied
    After going back into the book the formula Bollinger lists is:
    10-day sum of [(close-open) / (high-low) * volume] / 10-day sum of volume.

    bolded is the part I think I forgot to mention. Thanks for your help koganam! I really appreciate it.

    Leave a comment:


  • koganam
    replied
    I want to basically do this:
    AD.Set((CurrentBar == 0 ? 0 : AD[1]) + (High[0] != Low[0] ? (((Close[0] - Low[0]) - (High[0] - Close[0])) / (High[0] - Low[0])) * Volume[0] / 10-day sum of volume) : 0));
    That pseudocode as written cannot compile because you have introduced an ambiguous closing bracket and so the expression does not make sense. Now that you have a idea of the formula, describe in English what the requirement is. Are you simply trying to divide the current value (as defined in the original file), by the 10-day sum of volume ?

    Leave a comment:


  • kzuschlag
    replied
    Originally posted by koganam View Post
    Code:
    double dblCumulative10DayVolume = SUM(Volume, 10)[0];
    Remember to check for "dblCumulative10DayVolume == 0", and handle it appropriately. I cannot tell you how many times that I have come to grief for not thinking about that one.
    Thanks for your quick reply. I'm still a little confused on what exactly you are saying. Would you mind basically writing the exact code I would need to enter? I'm a complete noob at NinjaScript as you can probably tell.

    Leave a comment:


  • koganam
    replied
    Originally posted by kzuschlag View Post
    I'm wanting to normalize my accumulation distribution indicator over a 10 day period but I'm having a tough time adding the tiny bit of code necessary. Hoping any of your experienced NinjaScript users can help me out.

    Currently ADL has the code:
    AD.Set((CurrentBar == 0 ? 0 : AD[1]) + (High[0] != Low[0] ? (((Close[0] - Low[0]) - (High[0] - Close[0])) / (High[0] - Low[0])) * Volume[0] : 0));

    I want to basically do this:
    AD.Set((CurrentBar == 0 ? 0 : AD[1]) + (High[0] != Low[0] ? (((Close[0] - Low[0]) - (High[0] - Close[0])) / (High[0] - Low[0])) * Volume[0] / 10-day sum of volume) : 0));

    bold is what I added. This indicator is talked about in John Bollinger's book in case any of you were curious.
    Code:
    double dblCumulative10DayVolume = SUM(Volume, 10)[0];
    Remember to check for "dblCumulative10DayVolume == 0", and handle it appropriately. I cannot tell you how many times that I have come to grief for not thinking about that one.

    Leave a comment:


  • kzuschlag
    started a topic Accumulation Distribution %

    Accumulation Distribution %

    I'm wanting to normalize my accumulation distribution indicator over a 10 day period but I'm having a tough time adding the tiny bit of code necessary. Hoping any of your experienced NinjaScript users can help me out.

    Currently ADL has the code:
    AD.Set((CurrentBar == 0 ? 0 : AD[1]) + (High[0] != Low[0] ? (((Close[0] - Low[0]) - (High[0] - Close[0])) / (High[0] - Low[0])) * Volume[0] : 0));

    I want to basically do this:
    AD.Set((CurrentBar == 0 ? 0 : AD[1]) + (High[0] != Low[0] ? (((Close[0] - Low[0]) - (High[0] - Close[0])) / (High[0] - Low[0])) * Volume[0] / 10-day sum of volume) : 0));

    bold is what I added. This indicator is talked about in John Bollinger's book in case any of you were curious.

Latest Posts

Collapse

Topics Statistics Last Post
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
0 responses
574 views
0 likes
Last Post Geovanny Suaza  
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
0 responses
332 views
1 like
Last Post Geovanny Suaza  
Started by Mindset, 02-09-2026, 11:44 AM
0 responses
101 views
0 likes
Last Post Mindset
by Mindset
 
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
0 responses
553 views
1 like
Last Post Geovanny Suaza  
Started by RFrosty, 01-28-2026, 06:49 PM
0 responses
551 views
1 like
Last Post RFrosty
by RFrosty
 
Working...
X