What is #Sector time series and from where does it come?

I’m trying to double-check the results from this formula:

BetaFunc(1, 20, 0, 0, #Sector)

From what I understand, #Sector pulls a dynamic, internally generated sector benchmark based on the stock’s classification. Is that correct?

For example, let's look at JNJ (Healthcare sector).

I’d like to see

  1. The exact daily time series #Sector is using for JNJ’s sector over the same period BetaFunc is calculating (20 trading days in this example).
  2. See how that time series is calculated. From where does it come? Is this a security?
  3. I also want to export that time series via API like I do a stock.

Has anyone done this before? I searched the KB to no avail.

Thanks!

https://www.portfolio123.com/app/multi Click in "Ticker or Search Terms." Then click on RBICS.

Also, https://www.portfolio123.com/app/taxonomy is very useful.

You can create your own time series by using Close(0,#Sector) in the aggregate series tool.

The time series are calculated internally. They don't correspond to an ETF or other ticker.

2 Likes

Series construction is done per region and constituents are filtered as follows on a daily basis.

Starting Universe: Primary universe of the region

Rules, translated from the construction code:

Vol(0) > 0
LoopSum("Close(CTR) > 1", 125) = 125 // USD & CAD, minimum varies by currency
LoopSum("Vol(CTR) = 0", 125) < 10
AvgDailyTot(125) > 100000 // USD & CAD, minimum varies by currency

Returns are weighted by SharesCur(0).

Thanks @yuvaltaylor and @aschiff. This was exactly what I needed. Wow.

Given the speed and detailed response, I feel like I owe an explanation of why I asked!

I’m exploring whether hedging by sector could help address some of the challenges in managing long-short portfolios (as discussed previously on these boards), or perhaps volatility in long only portfolios. Early results suggest that factoring both market and sector variables makes return forecasting more accurate, something we can now do with AI Factor. But we still lack a way to review how a portfolio would perform under this approach.

@aschiff I'm having trouble finding a way to recreate this series. I believe I'm stuck on weighting the returns by SharesCur(0). Do you know how it can be done using P123 tools?

Following up here on the sector question and noticed there’s no documentation for #Bench [ i.e Close(0, #Bench) ] either. From where does this come and how it is computed, if proprietary? How do we know what series is being used for each stock?

Thanks again.

Can you try using Aggregate Series with Transform set to Cumulative Product? You can try weighing returns by SharesCur(0) using UnivSum / UnivSum.

#Bench is just the selected benchmark. Where are you using it?

I’m calling both of those with BetaFunc. I don’t see how to calc beta to market or sector per stock easily any other way.

Once I have that, I’ll need something investable. The current sector proxy isn’t, unfortunately.

Thank you!

How does this work? In the ranking systems, when you request ranks, there is no selected benchmark yet results are produced.

AI Factors have a benchmark setting in Target & Universe, so the feature using #Bench is referencing the one assigned there.

Let me know if you have any trouble making an index using Aggregate Series.

Thanks Aaron. I was referring to the traditional ranking systems. Like here where there is no benchmark specified but at this point, I think this is being a bit pedantic:

Since I want to incorporate the sector beta into portfolio construction, is there a way to use the beta calc on an investable ticker, like it’s respective ETF (i.e XLF, for financials).

Something like this formula:

( Close(0) / Close(252) - 1 ) - BetaFunc(1, 252, 0, 250, #Bench) * ( Close(0, #Bench) / Close(252, #Bench) - 1 ) - BetaFunc(1, 252, 0, 250, #Sector) * ( Close(0, #Sector) / Close(252, #Sector) - 1 )

I run out of char with eval to determine each stock’s sector and select the etf.

#Bench fails if used directly within a Ranking System. It only works if used in contexts that have a benchmark. This includes AI Factor features/target, also covering the use of AIFactor(...) within a Ranking System. In that context, it always uses the benchmark of the AI Factor.

Try something like the formula below, where $investablesector is of the form Eval(Sector = FINANCIAL, GetSeries("XLF"), Eval(…)). The Eval below exists only to save some computational work, since it would otherwise evaluate $investablesector twice.

Eval(@sec:$investablesector, Ret%Chg(252) - BetaFunc(1, 252, 0, 250, #Bench) * Ret%Chg(252, 0, #Bench) - BetaFunc(1, 252, 0, 250, @sec) * Ret%Chg(252, 0, @sec), NA)

Unfortunately, there’s no succinct way to parametrically select tickers for such uses.

Side note: I recommend double checking the arguments to BetaFunc. The current arguments are computing daily beta starting a year ago.