Skip to content
All library documents

Risk-Return Scatterplots and Weighted Portfolio Analysis Using MPT

Article TradingView scripts

Summary

This indicator compares the annualized risk and return of up to ten selected assets over a chosen historical start date. It calculates returns from price changes, estimates risk using return standard deviation, and annualizes both measures using a daily-data convention. Each asset appears on a risk-return scatterplot, with a weighted portfolio point calculated from user-entered asset weights. A table shows enabled symbols, their weights, total allocation, and any residual cash when allocations are below the full portfolio.

The chart also marks a user-specified risk-free rate and draws reference lines associated with the portfolio and capital allocation. The included defaults are crypto symbols, though users can replace them. This is a visualization and simplified portfolio comparison, not a full optimizer: portfolio risk is formed from weighted individual risk values and does not model covariance between assets. It provides no out-of-sample results, and conclusions depend on the chosen period, symbols, weights, data frequency, and return assumptions.

Key ideas

  • The indicator plots selected assets by annualized return and standard-deviation risk.
  • Users supply asset weights, and the portfolio point combines weighted asset risk and return estimates.
  • A table displays allocation totals and residual cash when the selected weights sum to less than the whole portfolio.
  • The visual includes a user-set risk-free rate and capital-allocation reference lines.
  • The portfolio risk calculation omits cross-asset covariance, limiting its use as a complete MPT analysis.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.