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).