So, it depends if you mean that you want the system to aggregate portfolios by beta, or if you mean you want the system to calculate CAPM Beta for you. If you mean the former, the aggregator looks for the latest value in a time series with an identifier that matches that of the position you’ve created in a portfolio. More specifically, it looks up a time series with the field name APPLIED_BETA (which is where we store a precomputed beta, typically from Bloomberg). So if you have a position with a Bloomberg ticker of ‘AAPL US Equity’, that references a security in the security master (which we create using a Bloomberg loader that populates the Security Master entry with field lookups from Bloomberg). That security has a ‘bundle’ of the various identifiers which can be used to look up that security. Within the aggregator, we are able to access the security object, and we take the identifier bundle and pass it to the HistoricalTimeSeriesSource interface, which looks up that bundle with a field of ‘APPLIED_BETA’ and using the ‘DEFAULT_TSS_CONFIG’, which is a set of rules stored in the configuration master that specifies how to resolve any ambiguities if multiple time series are found (e.g. if you have one sampled at the time the new york markets close, do you choose that over the London close?).
That beta value is then used to place the position into one of several pre-determined ‘buckets’, and we then create an arbitrary portfolio using those. So, the steps you need are:
Create security objects in the security master either from e.g. csv files as provided in the examples package, or using a custom built loader for your data provider.
Create your portfolio with references to those portfolios, again there are examples in the examples package.
Populate the time series database with APPLIED_BETA field data. This will be done in a similar way to the way PX_LAST data is currently populated in the examples from a file, or you can write your own provider that reads from e.g. Yahoo or Google.
Build a view definition, set the columns you want to see (may include CAPM Beta for example), and set the portfolio to the one you’ve created.
Go to the analytics view and try and load it, then choose ‘Beta’ under the ‘Aggregate by’ drop-down.
If you want to just see computed CAPM beta, you can skip step 3 here, and make sure you add CAPM Beta as a requirement in the view definition. You’ll need to have price history (PX_LAST) for the stocks in question so the PnL series can be calculated though.
There are various optional parameters that you can set as constraints on the CAPM Beta requirement too. I’ve included the default values after the constraint names
SamplingPeriod=P2Y (2 years)
look at the CAPMFunction functions and DemoStandardFunctionConfiguration.java in OG-Financial to see more details.