Net Advancing Volume Percent

Hii Sirs,
I wanted to build a breadth measure of Net Advancing Volume percent.

(Advancing Volume- Declining volume)/Total Volume;

How to calculate total volume.

Whereas
Advancing Volume is

u1=volume(); 
u2=CHANGE(u1) >0; 
u2

Declining Volume is

u1=volume();
u2=CHANGE(u1) <0; 
u2

Regards
Deepak

Hi,

I’m also building this breadth, however I’m unsure if my total Advance/Decline Volume script is correct.
My scripting is different however achieves the same (forgive me I’m still relatively new to scripting):

Advancing Volume:
u1 = VOL();
u2 = VOL(OFFSET=-1);
u3 = u2 - u1;
u3 > 0

Declining Volume:
u1 = VOL();
u2 = VOL(OFFSET=-1);
u3 = u2 - u1;
u3 < 0

Advance/Decline Volume:
u1 = VOL();
u2 = VOL(OFFSET=-1);
u3 = u2 - u1;
u4 = u3 > 0;
u5 = u3 < 0;
u6 = (u4 - u5) / u1;
u6

Can anyone guide us on this?

We have the following data (including advance/decline volume ratio) in our Breadth Measures data if you have it enabled on your account:

https://help.optuma.com/kb/faq.php?id=1062

So Advance/Decline Volume Percent for the ASX200 has the symbol ADVPASX200:

Capture

We’ll be adding this data for the Indian NSE exchange in the next few months, but it’s a bit tricky to calculate manually. What you would need to do is calculate two breadth measures: one summing the advancing volume and one declining volume.

C1=CLOSE();
P1=VOL();
//Calculate Advance/Decline volume;
ADV1 = IF(C1 IsUp, P1,0);
DEC1 = IF(C1 IsDown, P1,0);
//Output ADV1 for Advances or DEC1 for Declines
ADV1

Once ADV1 and DEC1 have been calculated in Market Breadth, use the Data > Custom Codes to calculate the ratio, which would be:

A1=GETDATA(CODE=ADV1:Market Breadth);
D1=GETDATA(CODE=DEC1:Market Breadth);
(A1-D1)/(A1+D1)