Creating Advance/Decline line with Custom Breadth Module

If you have access to the Custom Breadth Module you can build you own cumulative Advance/Decline line for your portfolio or for indices not included in our Breadth Data.

Before starting, make sure that you have the list of symbols you want to build the measure for as a Symbol List, and then under Data > Market Breadth menu in Optuma use the following the formula (remember true conditions are assigned a value of 1 so they can be counted):

//Count advances;
U1 = CHANGE() > 0;
//Count declines;
D1 = CHANGE() < 0;
//Calculate advances minus declines;
U1 - D1

Select the Symbol List to use under Codes to Include, and give the data a Symbol and Name, and set the Breadth Action to Cumulative, and click Build Breadth.


Once created, the chart can be opened or it can be added under a price chart using the Breadth Data tool.

Create an A/D Line for NIFTY50 index

This example will calculate the A/D line for the Indian NIFTY50 index, which now includes survivorship bias-free data back to 2011. This requires you to have the Optuma Symbol Lists on your account, and the NSE Indian data. The process is the same as above, but requires the ISMEMBER() function so that only the stocks that were in the index on that day will be included in the historical calculation:
//Count advances for stocks in the index;
U1 = CHANGE() > 0 and ISMEMBER(SYMBOLLIST=NSE Nifty 50 Index);
//Count declines for stocks in the index;
D1 = CHANGE() < 0 and ISMEMBER(SYMBOLLIST=NSE Nifty 50 Index);
//Calculate advances minus declines;
U1 - D1

This is a helpful explanation. However, I am having a hard time thinking through a different application.

I am looking to build a breadth indicator that measures the volume of advancing issues as a % of total volume (advancing + declining volume).

However, what should the return variable be to bring in the volume of only those advancing stocks versus the total volume of advancing and declining stocks.

Maybe I should have picked an easier first time to try the breadth module? :laughing:

Hi Eric,

To build this for custom lists would be tricky as you would need to calculate the total volume first, but if it’s for an index you can use the -AV and -DV symbols in in our Breadth data, and use the following calculation in a Show View, eg for S&P500:

AV1/(AV1+DV1) * 100

Today the values were nearly identical so the value was 50%. Also, note we have SPX-ADVP in our database which is slightly different, and ranges from -100 to 100 using (AV1-DV1)/(AV1+DV1). See the bottom panel here:

To create an Advance / Decline Volume line (similar to SPX-ADVL in our database) you could use the following with a Cumulative calculation in the breadth engine:

AV1=IF(CLOSE() IsUp, VOL(), 0);
DV1=IF(CLOSE() IsDown, VOL(), 0);

Thank you Darren. That is helpful. I will work with that construct.