VAR (Value at Risk)

Posted By: tradingest

VAR (Value at Risk) - 01/05/19 18:29

Hi guys,

anybody use the formula or indicator to obtain the correct VAR of a portfolio strategy?

Wikipedia def
What is the VAR? Value at risk (VaR) is a measure of the risk of loss for investments. It estimates how much a set of investments might lose (with a given probability), given normal market conditions, in a set time period such as a day. VaR is typically used by firms and regulators in the financial industry to gauge the amount of assets needed to cover possible losses. For a given portfolio, time horizon, and probability p, the p VaR can be defined informally as the maximum possible loss during the time if we exclude worse outcomes whose probability is less than p. This assumes mark-to-market pricing, and no trading in the portfolio.[1] For example, if a portfolio of stocks has a one-day 5% VaR of $1 million, that means that there is a 0.05 probability that the portfolio will fall in value by more than $1 million over a one-day period if there is no trading. Informally, a loss of $1 million or more on this portfolio is expected on 1 day out of 20 days (because of 5% probability). Follow us for a good trading

Thanks
Posted By: MaskOfZorro

Re: VAR (Value at Risk) - 01/07/19 16:21

What's the question?

Never done it in Zorro, but Zorro lets you find covariances and construct a covariance matrix

Quote:
/ generate covariance matrix
for(i=0; i<N; i++)
for(j=0; j<N; j++)
Covariances[i][j] = Covariance(Returns[i],Returns[j],DAYS);


The you just need the weights vector and to perform matrix multiplication



Then multiply the portfolio value by the calculated portfolio sigma and the appropriate z-score for the confidence level you want (e.g. 1.645 for 95%).
© 2024 lite-C Forums