Sector wise breadth Data in a watch list

Hii Sir,

I have breadth module and i have created several sector based breadth data. Is it possible to use the data in watch list. Because if i put breadth data of one sector whole column gives the same value so i need to add other column for other index, Is there a way around to it.


Hi Deepak,

You can add the symbols you created in the breadth module to the watchlist so the value appears as a row and not a column.


I’d like to build on this thread. I have a breadth data tool that looks at the percent of stocks in the XLE that are above their 200 day simple moving average. On this tool I have added a 65 day simple moving average. Please see the attached workbook with the tool.

In a watchlist I would like to script two questions:

  1. Is the current close of the tool above the moving average?
  2. Is the moving average up?

I don’t know how to reference the breadth data/tool, or if it is even possible, when scripting for the watchlist. Thank you for your help on this.

SectorLevelTrendIndicator.owb (41.2 KB)


You can reference the Breadth code using the Getdata() function.

The Moving Average is then wrapped around the GetData item (so it’s calculated from that data rather than the charts). Once that’s done you can add your specific criteria.

Here’s a simple example but you will need to update it to use your custom breadth code data:

//Set Breadth Code
//Find MA Values applied to Breadth Code
V2 = MA(V1, BARS=65, STYLE=Simple) ;
//Is Breadth Code higher than 65SMA
V1 > V2

Hi Matthew. Thank you for your response. I always say it, and again please know I really appreciate how responsive and helpful you, and Darren, are. I was able to create both of my scripts with your instructions.

I have one more question regarding this workbook. The workbook now has a watchlist of 11 symbols with all 6 scripts of my model. Underneath the watchlist I have a chart. The chart has:

  1. Daily candlesticks with an SMA.
  2. A 12/26/9 MACD-C tool.
  3. A breadth data tool with a custom script and an SMA.

When I click through the symbols on the watchlist the chart changes. Numbers 1) and 2) update as I click through the symbols, but 3) does not. Is there a way to program Optuma so this workbook is fully automated, meaning the script in the breadth tool changes as I go through the symbols? Please see the workbook attached. Thank you.

SectorLevelTrendIndicator-1.owb (91.4 KB)

Hi Louis,

Item 3 is a static item that won’t change when the primary chart code is adjusted (ie there’s no call back to the charts code). It’s a breadth code and a MA based off of that breadth code, so the values are unaffected by the primary charts data.

What change were you expecting to see when the code is adjusted?

The watchlist is the 11 S&P 500 sectors. The breadth script is to find the percentage of stocks above their 200 day SMAs. I was hoping to click through the watchlist and have the breadth data update to match the chart as I click through the sectors.


There’s no way to do that with the Breadth Data tool, but you could achieve the result with some creative scripting using a mix of ISTICKER() and IF() functions to display a specific breadth code based on the chart selected via a Show View tool.

Here’s an example using 3 different codes setup from your workbook (but using my own breadth code references as I don’t have yours). I’ve included comments for each section of the script to show what its function is…

//Set Source Check Codes
//Set Paired Breadth Codes
B1 = IF(T1,GETDATA(CODE=BREATHCODE5:Market Breadth),0) ;
B2 = IF(T2,GETDATA(CODE=BREADTHCODE~2:Market Breadth),0) ;
B3 = IF(T3,GETDATA(CODE=BREADTH4:Market Breadth),0) ;
//Set Script to display specific breadth code based on selected chart
P1 = B1 + B2 + B3 ;
//Set MA for Selected Breadth Code
M1 = MA(P1, BARS=65, STYLE=Simple) ;
//Show selected Breadth Code and MA Line
plot1 = P1;
Plot2 = M1;

In the above example, if I select the code SP500-10 to display on the chart, BreadthCode5 is displayed. If I select SP500-15 Breadth code 2 is displayed and if I select SP500-20 Breadth Code 4 is displayed.

The 65SMA will calculate off the breadth code currently in view and will update as well.


You’d just need to update the script with all of the codes you’ve added in the Watchlist, and their corresponding Breadth codes for it to work. It will become quite complex the more codes you add to it, but it will achieve the result you’re after.

Hii Sir,

Can i apply is ticker to manual lists.



I mean to say can we call values of B1 B2 & B3 in manual list in same column.


Screenshot 2021-09-02 174317

This is what I wanted Thnks


Yes, the ISTICKER() should work for that Watchlist as well.