Up-Down Volume Ratio Script


Category:
0
0

Hi Pete,

Would you able to assist me with creating a script in the form of AddLabel that calculates the up/down volume ratio?

Up-Down Volume Ratio covers previous 50 days of trading. It’s calculated by dividing total volume on up days by total volume on down days. Target stocks with ratios above 1.0.

This is IBD’s investing methodology targeting top stocks showing signs of accumulation. The term accumulation means gains in rising volume and is synonymous with institutional buying.

Thank you!

 

 

RESOLVED
Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on March 5, 2021 8:10 pm
1195 views
0
Private answer

I think this should do it. You did not provide an example so we can check if this code is computing correctly so we just have to trust the code.

declare lower;
input length = 50;
def upDayVolumeTotal = Sum(if close > open then volume else 0, length);
def downDayVolumeTotal = Sum(if close < open then volume else 0, length);
plot data = upDayVolumeTotal / downDayVolumeTotal;
AddLabel(yes, Concat("Volume Ratio: ", data), Color.WHITE);

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on March 6, 2021 5:24 pm
0
Pete, thank you! The code is computing correctly.
( at March 7, 2021 7:25 am)