top of page

Portfolio Value-at-Risk (VaR)

The project calculates the value-at-risk for a single security or a portfolio using both the parametric method and Monte Carlo simulations, which returns the maximum potential loss for a given time period with a certain confidence level, assuming that returns are normally distributed.

Importing the required libraries:

Screen Shot 2022-09-12 at 14.26.04.png

Calculating VaR if the length of the given tickers is 1:

Screen Shot 2022-09-12 at 14.26.49.png

Calculating VaR if the length of the given tickers are greater than 1:

Screen Shot 2022-09-12 at 14.27.42.png

Final output where VaR is calculated using the parametric method.

In addition, the potential range of the portfolio value could be determined by observing the Monte Carlo simulation chart.

Tickers, timeframe, portfolio size, weights, confidence level, and the number of days could be changed as desired.

Screen Shot 2022-09-12 at 14.28.19.png
bottom of page