post https://api-lib.bambu.life/api/portfolioBuilder/v2/returnsStatistics
This API calculates the annualised returns and risks (standard deviations of returns), as well as covariances and correlations with other funds, of all funds selected by the user. These values are calculated based on daily funds' prices inputted by the user. User can also override expected returns and expected variances based on their company’s in-house estimation for calculation of annualised returns, risks and covariances of the funds.
Request Body
Name | Datatype | Description | Mandatory | Sample values | List of Possible values | No. of decimals | Notes |
---|---|---|---|---|---|---|---|
priceRecords | Array of dictionaries | Record of daily funds' prices | Y | ||||
divAdjClose | Float | Daily dividend adjusted prices of funds | Y | 37.06 | 2 | ||
symbol | String | Symbols of funds | Y | “QQQ” | NA | ||
date | String | Date of price data | Y | "2008-08-22" | NA | ||
productDictionary | Array of dictionaries | Contains additional constraints on weights of funds and information to be overridden. | Y when either “override“, “bucket“, “classification“ is true | ||||
symbol | String | Symbols of funds | Y | “QQQ” | NA | ||
Classification | String | Classification of the fund in core-satellite investing. | Y when “useClassifications“: true | "UC" | “UC“, “C“, “S1“, “S2“ | NA | Higher weights are allocated to “UC“ (ultra-core) funds, followed by “C“ (core), “S1“ (satellite 1) and “S2“ (satellite 2) funds. |
riskBucket | String | Classification of the fund’s riskiness. | Y when “useRiskBuckets“: true | "Safe" | “Safe“, “Risky“ | NA | Weights of “Risky“ funds are ensured to be lower than weights of “Safe“ funds |
expectedReturn | Float | Expected returns of the fund to be used instead of calculating based on “priceRecords” | Y when “useRiskBuckets“: true | 0.01 | >=0, <=1 | not limited | |
expectedStdDev | Float | Expected variances of the fund to be used instead of calculating based on “priceRecords” | Y when “override“: true | 0.01 | >=0, <=1 | not limited | |
override | Boolean | To use expectedReturn and expectedStdDev of funds in “productDictionary“ rather than calculate from “priceRecords” | Y | false | true, false | NA | |
useRiskBuckets | Boolean | To add constraints on weights of funds based on funds' riskiness | Y | false | true, false | NA | |
useClassification | Boolean | To add constraints on weights of funds based their classifications in core-satellite investing | Y | false | true, false | NA |
Response Body
Name | Datatype | Description | Sample value | No. of decimals | Notes |
---|---|---|---|---|---|
annualizedReturnsAndStdDevs | Array of dictionaries | ||||
symbol | String | Symbol of fund | "AAXJ" | NA | |
return | Float | Annualized return of the fund | 0.0132 | 4 | |
stdDev | Float | Annualized standard deviation of returns of the fund | 0.0231 | 4 | |
AnnualizedCovariance | Array of dictionaries | ||||
rowSymbol | String | Symbol of the first fund in the pair for covariance calculation | "AAXJ" | NA | |
columns | Array of dictionaries | ||||
columnSymbol | String | Symbol of the second fund in the pair for covariance calculation | "AAXJ" | NA | |
value | Annualized covariance between first and second fund in the pair | 0.072 | 4 | ||
annualizedCorrelation | Array of dictionaries | ||||
rowSymbol | String | Symbol of the first fund in the pair for correlation calculation | "AAXJ" | NA | |
columns | Array of dictionaries | ||||
columnSymbol | String | Symbol of the second fund in the pair for correlation calculation | "ACWI" | NA | |
value | Annualized correlation between first and second fund in the pair | 0.0087 | 4 | ||
runningTime | Float | Total API running time | 0.0547 | 4 | in seconds |