Thanks for presenting interesting concept.
Indeed, it works in P123, even without assigning specific weights (I do not have access to dynamic weights feature).
This formula should do most of the job:
@prob_outperf_spy: ((LoopSum(`FHist("Rel%Chg(1,GetSeries(`SPY`))", CTR) > 0`,60)/ 60) / TRSD1YD)
You can double check if the formula is correct.
I created a public screen that selects etfs every 4 weeks which has zscore(@prob_outperf_spy) > 0. I added also GLD to the universe. Feel free to modify this Screen or create simulation with dynamic weights.