Backtest Portfolio

This API generates unrebalanced and rebalanced daily portfolio values based on user’s input of daily funds' prices and weights on each fund. This API also calculates the annualised return, risk and Sharpe ratio of the portfolio.

Request Body

NameDatatypeDescriptionMandatorySample ValueList of possible valuesNo. of decimal placesNotes
priceRecordsArray of dictionariesRecord of daily funds' pricesY
divAdjCloseFloatDaily dividend adjusted prices of fundsY37.062
symbolStringSymbols of fundsY“QQQ”NA
dateStringDate of price dataY"2008-08-22"NA
portfolioWeightsArray of dictionariesY
symbolStringSymbols of fundsY“QQQ”NA
weightFloatWeights on respective fund in the portfolioY0.5>=0, <=14All weights must sum to 1
rebalancingStrategyDictionaryNRemove this dictionary to obtain only unrebalanced portfolio values
calendarDictionaryN
selectBooleanTo rebalance portfolio based on a frequency selectedNtruetrue, falseNAOnly one of calendar and percentageOfPortfolio can be true
typeStringRebalancing frequencyN“yearly”“yearly“, “quarterly“ or “monthly“NA
percentageOfPortfolioDictionaryN
selectBooleanTo rebalance portfolio based on percentage change of weights of funds in the portfolioNfalsetrue, falseNAOnly one of calendar and percentageOfPortfolio can be true
valueFloatPercentage of entire portfolioN0.2004
showRebalancingDatesBooleanTo show dates when portfolio rebalancing occurNtruetrue, falseNA
riskFreeRateFloatRisk free rate for calculation of Sharpe ratioN0.05>-1, <14

Response Body

NameDatatypeDescriptionSample valueNo. of decimalsNotes
portfolioGraphArray of dictionariesDaily unrebalanced portfolio values
dateStringDate"2007-01-05"NA
valueFloatUnrebalanced portfolio value on each date100.02
portfolioSummaryDictionarySummary of unrebalanced portfolio
annualizedReturnFloatAnnualized return of unrebalanced portfolio0.012222388
annualizedStdDevFloatAnnualized standard deviation of unrebalanced portfolio returns0.221692218
sharpeRatioFloatSharpe ratio of the portfolio0.1660946
rebalancedPortfolioGraphArray of dictionaries
rebalancedPortfolioSummaryDictionaryDaily rebalanced portfolio values
dateStringDate"2010-01-27"NA
valueFloatRebalanced portfolio value on each date100.02
rebalancedPortfolioSummaryDictionarySummary of rebalanced portfolio
annualizedReturnFloatAnnualized return of rebalanced portfolio0.012222388
annualizedStdDevFloatAnnualized standard deviation of rebalanced portfolio returns0.221692218
sharpeRatioFloatSharpe ratio of the rebalanced portfolio0.1660946
rebalancingDatesArrayDates when portfolio rebalancing occur[“2010-04-01", "2010-05-06", …]NA
Language
Authorization
Bearer
Click Try It! to start a request and see the response here!