Having trouble with scanning manager

I am trying to simply create a scan to show which stocks within the S&P 500 have outperformed the index itself over the past 12 months.

When I run the scan, it provides me with 499 results, which is not correct.

I know I am missing something obvious, but I can’t figure it out.

a1=GETDATA(CODE=SPX:WI);
b2 = CHANGE(Month(PERIODAMOUNT=1), INT_COUNT=12, INT_TYPE=Bars);
b3 = CHANGE(a1, Month(PERIODAMOUNT=1), INT_COUNT=12, INT_TYPE=Bars);

b2 > b3

Hi John,

Use the RIC() function to calculate the relative returns:

For US stocks it will use SPX by default, but can be changed to anything else if required.

Here’s all you need for out-performance over the last year:

RIC(DATESEL=Last Year, ZEROBASED=True)>0

Currently there are only 175 stocks (35%) outperforming the index over the last year. Here’s the list ranked by outperformance (RIC(DATESEL=Last Year, ZEROBASED=True)) led by $VST with 245% (which only joined the index earlier this month).

1 Like

Thanks Darren!

I don’t know why I didn’t use RIC. I’m a bit embarrassed now to have asked the question.

1 Like

No worries! I just tweeted this about the decline of YTD outperformance since the April low:

https://x.com/Optuma/status/1795957899857915944

It was calculated using the custom breadth engine and this formula:

RIC(DATESEL=Year To Date, ZEROBASED=True) > 0
1 Like