I have a watchlist for the S&P 500. Please see picture 1 attached.
The first column is the 13-week ROC for each symbol.
The second column is the 13-week ROC for SPX.
The third column is Column1 - Column2. The result is > 0 when the symbol has outperformed SPX on a rolling 13-week basis.
Using the breadth engine, I want to count the number of symbols where the third column is > 0. I have tried several scripts, but none generate the 160 number to match the watchlist. Please help. Thank you.
Hi Optuma team. I would like to follow up on this topic please. I am trying to create a breadth script to count the number of S&P 500 components which have outperformed the index over the last rolling 13 weeks.
I was hoping the following script would do it, with the breadth action set to Count, but something is not correct. Please advise. Thank you.
What appears to be off the number of stocks? If I take your code through yesterday (5/1/23) I get 166 stocks in both the Scan and Breadth Function with the attached settings. If you could elaborate it might be an easy fix…
Hi Duke. Thanks for helping. I like your idea of using the scanning manager. Tonight my watchlist says there are 164 stocks outperforming SPX looking back 13-weeks, see picture 1. The same is true for the scan with the same script. The breadth engine counts 189, which is different than the watchlist and scan. See picture 2.
The 164 result is generated using the following script. It scripts a 1 if the 13-week ROC is greater than SPX’s. It counts 164:
Well, HMMM… not sure what is going on… I get the same 164 securities on the scan and the breadth. I thought it might be because you were using Historical Constituents but I get the same number using either Historical or current so that doesn’t appear to be the issue. Just out of curiosity, you might try re-downloading the Indices and Equity data files under Exchanges. I had some issues with my data files and that solved some irregularities in my data I was seeing in scans and watchlist columns. It might not solve the issue but it would be the first place I would start. I will ponder this some more…
Yes! Duke, thank you! I downloaded the exchange data manually as you suggested, and now the breadth tool counts 164. Problem solved. I am so happy. Thank you again.