Exercise

# Historical value at risk

Drawdown is a measure of sustained losses over time, but what about simple single-day movements?

**Value at Risk**, often referred to as VaR, is a way to estimate the risk of a single day negative price movement. VaR can be measured for any given probability, or confidence level, but the most commonly quoted tend to be VaR(95) and VaR(99). Historical VaR is the simplest method to calculate VaR, but relies on historical returns data which may not be a good assumption of the future. Historical VaR(95), for example, represents the minimum loss that your portfolio or asset has sustained in the worst 5% of cases.

Below, you will calculate the historical VaR(95) of the USO oil ETF. Returns data is available (in percent) in the variable `StockReturns_perc`

.

Instructions

**100 XP**

- Calculate VaR(95), the worst 5% of USO returns (
`StockReturns_perc`

), and assign it to`var_95`

. - Sort
`StockReturns_perc`

and assign it to`sorted_rets`

. - Plot the histogram of sorted returns (
`sorted_rets`

).