backtestStrategy non-sensical example under backtest investment strategies help center page
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
on the otherwise amazing page:
there are 5 strategies defined, among which a Max_Sharpe_Ratio, based on a function maxSharpeRatioFcn, defined as:
function new_weights = maxSharpeRatioFcn(current_weights, pricesTT)
% Mean-variance portfolio allocation
nAssets = size(pricesTT, 2);
assetReturns = tick2ret(pricesTT);
% Max 25% into a single asset (including cash)
p = Portfolio('NumAssets',nAssets,...
'LowerBound',0,'UpperBound',0.1,...
'LowerBudget',1,'UpperBudget',1);
p = estimateAssetMoments(p, assetReturns{:,:});
new_weights = estimateMaxSharpeRatio(p);
end
Great! except, when the backtestEngine gets a runBacktest, the max_sharpe one produces:
- the lowest sharpe
- lowest total return
- highest volatility
- highest turnover
- max drawdown
- highest buy/sell cost
summaryByStrategies=9×5 table
Equal_Weighted Max_Sharpe_Ratio Inverse_Variance Markowitz_Optimization Robust_Optimization
______________ ________________ ________________ ______________________ ___________________
TotalReturn 0.18745 0.14991 0.15906 0.17404 0.15655
SharpeRatio 0.12559 0.092456 0.12179 0.10339 0.11442
Volatility 0.0063474 0.0070186 0.0055626 0.0072466 0.0058447
AverageTurnover 0.00087623 0.0065762 0.0028666 0.0058268 0.0025172
MaxTurnover 0.031251 0.239 0.09114 0.21873 0.073746
AverageReturn 0.00083462 0.00068672 0.0007152 0.00078682 0.00070651
MaxDrawdown 0.072392 0.084768 0.054344 0.085544 0.064904
AverageBuyCost 0.047298 0.3449 0.15228 0.3155 0.1328
AverageSellCost 0.047298 0.3449 0.22842 0.3155 0.1328
to note, one of the 5 strategies is the equal_weighted.
So, the question is: how (on earth), a strategy "designed" to produce a "max" sharpe, gets the lowest possible performance across the 5 of them ... mathematically it doesn't make sense ...
0 comentarios
Respuestas (1)
Alejandra Pena-Ordieres
el 16 de Dic. de 2024
Editada: Alejandra Pena-Ordieres
el 16 de Dic. de 2024
The backtest engine utilizes past data to estimate the mean and covariance matrix needed to find the maximum Sharpe ratio portfolio. Then, the maximum Sharpe ratio portfolio obtained from the past data is invested in future unseen data. However, as the old financial disclaimer goes, past performance is not a reliable indicator of future results. The example that you're referring to is one great example of the past performance disclaimer.
1 comentario
Alejandra Pena-Ordieres
el 16 de Dic. de 2024
"When analzying these results, remember that the backtest engine computes the weights using past data. At the moment the weights are computed (with the past data), the portfolio weights obtained from the Max_Sharpe_Ratio strategy are the ones that achieve the maximum Sharpe ratio. After those weights are computed, they are invested in future unseen data. Consequently, in this summary, the Max_Sharpe_Ratio results are the lowest SharpeRatio with lowest returns. This example demonstrates that past performance is no guarantee of future results and a strategy that has performed well in the past may not perform well in the future."
Ver también
Categorías
Más información sobre Portfolio Optimization and Asset Allocation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!