A Custom Time Period Portfolio Analysis (or CTP Portfolio Analysis for short) resource represents an analysis of one of the identified user’s portfolios but with a custom set of time periods. The portfolio in question may be owned by the user, or may be owned by another user and shared to the identified user. The resource contains basic information about the portfolio, analysis-specific information and information about the calculation (or execution) of that analysis. If the analysis has finished being calculated, then the resource exposes links to further resources that contain the analysis’s results data.
For the default, awaiting sign-off and signed-off portfolio analyses, Revolution calculates some pre-defined time periods which are configured in the portfolio settings of the Revolution website (e.g. Earliest to Latest, 1 Year to Latest etc). These pre-defined time periods are then accessible via the various Portfolio Analysis resources where results can be extracted for those time periods using the Segments Tree Node and Whole Segments Tree resources. There are other analysis resources such as TimeSeries, Multiple OCP Time Series and Interactive Statistics Analysis which allow callers to extract results for ad-hoc custom time periods outside of the pre-defined set of time periods on-the-fly. However, these have limitations as to the level at which results can be calculated. For example, TimeSeries and Multiple OCP Time Series resources can only be used to extract results at total and segment level and the Interactive Statistics Analysis only supports the extraction of total level results. This is why we have the concept of a Custom Time Period Portfolio Analysis resource which support the calculation of results all the way down to security level for a number of ad-hoc time periods.
Unlike other portfolio analyses, a CTP Portfolio Analysis is not exposed through the Portfolios resource but instead through one or more of the Default Portfolio Analysis, Awaiting Sign-Off and Signed-off portfolio analyses. A CTP Portfolio Analysis is only exposed through one of these analysis types if some results have been previously requested via the Portfolio Analysis Controller resource in their respective portfolio analysis resource. See details of the Portfolio Analysis Controller link relation for further details of how to request the calculation of a CTP Portfolio Analysis.
A portfolio analysis’s status is important. It indicates whether the calculation of the analysis is in progress, has finished, has failed, or whether no results are available. If the analysis is in progress then it will become either finished or failed at some point in the future. Re-request the resource periodically (say once every three seconds) to determine its final status.
If a portfolio analysis has finished (with or without messages), then analysis results are available, and returned representations will include links to the Segments Tree Node, Whole Segments Tree, Time Series and Multiple OCP Time Series resources that contain the analysis’s segments, securities, measures and time series data.
If a portfolio analysis has failed, then no analysis results are available. Instead the returned representation will include one or more error messages detailing why the analysis failed. The only exceptions to this are the Interactive Risk Analysis and Interactive Statistics Analysis which are available regardless of the portfolio analysis’s status. This is because these resources enable a new calculation on-the-fly and don’t depend on any previously calculated results.
Important Characteristics of CTP Portfolio Analyses:
The Custom Time Period Portfolio Analysis resource is exposed via XML and JSON representations, which have the following media type names:- > application/vnd.statpro.revolution.api.custom-time-period-portfolio-analysis+json
When a response is received from the web service with status 200 (= OK), the fact that the response contains an Custom Time Period Portfolio Analysis resource representation is indicated by the presence of one of these two response headers:- > Content-Type: application/vnd.statpro.revolution.api.custom-time-period-portfolio-analysis+json; charset=utf-8
Content-Type: application/vnd.statpro.revolution.api.custom-time-period-portfolio-analysis+xml; charset=utf-8
The Custom Time Period Portfolio Analysis resource always links to the Service, Porfolios, Historical Risk Trends, Portfolio Analysis Controller and Interactive Statistics Analysis resources (and to itself). If the portfolio is a not a Bronze portfolio, then it will additionally expose a link to the Interactive Risk Analysis resource. If the CTP portfolio analysis has finished then analysis results are available, and the resource will also link to the Segments Tree Node, Whole Segments Tree, Time Series and Multiple OCP Time Series resources. To do so, its resource representations use link relations:-
self link relation identifies the link to the current Custom Time Period Portfolio Analysis resource. Use this link to poll for availability of results (or calculation failure) if the current status indicates that the analysis is in-progress.
service link relation identifies the Service resource link.
portfolios-query link relation identifies the link that allows a new query for portfolios to be made.
portfolios-analysis-controller-query link relation identifies the link that allows a new query for triggering the (re-)calculation of this custom time period portfolio analysis.
historical-risk-trends link relation identifies the Historical Risk Trends resource link.
interactive-risk-analysis-query link relation identifies the link that allows a new query for performing an on-the-fly interactive risk calculation to be made.
segments-tree-root-node-query link relation identifies the link that allows a client application to extract segments, securities and measures from the Segments Tree via a query that starts at the tree’s root node.
whole-segments-tree-query link relation identifies the link that allows a client application to extract segments, securities and measures from (potentially) the whole of the Segments Tree, without having to query for each node.
time-series-query link relation identifies the link that allows a client application to extract time series data for one or more measures for the Total segment. (Links to time series data for other segments are exposed by the Segments Tree Node resource.)
multiple-ocp-time-series-query link relation identifies the link that allows a client application to query for Overall Custom Period (OCP) time series data for multiple segments, multiple measures and multiple time periods.
interactive-statistics-analysis-query link relation identifies the link that allows a new query for performing on-the-fly interactive statistics calculations to be made.
All related resources are accessed using the HTTP GET method, with the exception of the following which are accessed via the POST method:
Please refer to Portfolio Analysis - Processing Messages.
fixedIncomeEnabledare now available. The
Platinumis no longer exists - December 2018
categoriesare now available for the
errorscollections - October 2018
statusUpdatedis now available - May 2018
investmentStrategyare now available - August 2017.
Last updated: October 2018