Benchmark is Undefined

I get this error when I use this formula from my ai model in my own model:

Error:
“In 'v13 - Tester'-> In 'Tester 1'-> Benchmark is undefined for function HighPct()”

Formula:

HighPct(251) - HighPct(251, #Bench)

I copied this formula from mine of my AI models.

I don’t see any documentation for this. How do you use #Bench?

I do have a benchmark set under the backtest under universe and ranking - it’s set to s and p 500

You cannot use #bench in a ranking system. Ranking system don't have the ability to resolve what #bench is, which depends on what system is using the ranking system, like a screen, or portfolio strategy, etc.

Try specifying the series parameter like this:

HighPct(251, $SP500)
or
HighPct(251, GetSeries("SPY:USA"))

The second one is if you want to include dividends. For a complete list of series IDs, see MISC→TIME SERIES IDS.

Ah i see now. Thanks!!