Quantra Classroom | Measuring Market Risk: VaR and Expected Shortfall

Welcome to Quantra Classroom on managing market risk! In today's fast-paced and ever-changing market, it is essential to understand the risks associated with trading. Today, we aim to provide you with the knowledge and skills to effectively manage market risk.



You will learn:

  1. What market risk is?
  2. How to quantify market risk using VaR (Value at Risk) and ES (Expected Shortfall)?
  3. How to use options for hedging exposure?



    What is market risk?

    Market risk is the risk of losses on financial investments caused by adverse price movements. Examples of market risk are: changes in equity prices or commodity prices, interest rate moves or foreign exchange fluctuations.



    Why is it important to quantify market risk?

    Let’s say we have a long-only equities portfolio. This portfolio has a possibility to experience losses due to market risk. Hence it is important for you to quantify this risk. As a quant, you go by the saying, “Anything that is important always needs to be quantified”.



    How do we quantify market risk?

    We will look at two methods to quantify the market risk:
  4. Value at Risk
  5. Expected Shortfall



    These methods are covered in detail in this unit of Options Trading Strategies In Python: Advanced course. 



    VaR, or Value at Risk:

    Imagine you have a stock portfolio. VaR is a way to figure out how much money you could lose over a certain amount of time with a certain level of certainty. For example, a 1-day VaR of your portfolio is $5 million with a 99% confidence level means that there's only a 1% chance that you'll lose more than $5 million in one day.



    So most days, you won't lose more than $5 million, but there's still a tiny chance that you could lose more. It's like predicting the worst-case scenario so you can be prepared for it.



    But how did we arrive at this VaR value of $5 million?

    The steps followed to calculate the VaR are as follows:
  • Get the price data of all the stocks in the portfolio
  • Calculate the daily returns of all the stocks in the portfolio
  • Add all the stock returns to compute portfolio returns. Here we have assumed equal allocation to all the stocks in the portfolio.
  • Sort the portfolio returns from worst to best.
  • The 99th, 95th, and 90th percentile values are the VaR for 99%, 95%, and 90% confidence levels, respectively.

You can get the Python code for calculating VaR from this unit of the Options Trading Strategies In Python: Advanced course on Quantra. You would have to enrol into a free course preview to access the Python code.
 
But is VaR the best choice?
Consider the following scenario. Suppose the risk department of a hedge fund tells a trader that the 1-day 99% VaR must not be more than $1 million. By posing this restriction, the risk department controls the risk exposure a trader can take while trading. On the other hand, to make a profit and seek higher payoffs, the trader might want to take a risky position. So although the trader will keep a daily loss of less than $1 million with a 99% probability, as he is required, he might keep the loss as high as $100 million for that 1% chance.
 
In this case, the trader satisfies the risk limits imposed by the fund but at the same time is taking an unacceptably high risk for 1% of the time. The graph shown below represents this scenario.

VaR and Need for Expected Shortfall
VaR is a measure of risk that tells you the maximum amount of money you could lose with a certain level of confidence. But it doesn't consider how much you could lose beyond that maximum amount. This is where Expected Shortfall comes in. It's a better way to measure risk because it looks at the average loss you could expect beyond the maximum amount. It takes into account the likelihood of those losses happening. So if your VaR is $1 million, Expected Shortfall would tell you how much more you could lose beyond that $1 million, on average. 

Expected Shortfall
When you look at a normal distribution curve, the area on the left side is where the losses occur. To find the Expected Shortfall, we will add the average of the worst losses that happen less than 1% of the time.

Now consider a scenario where the risk department of the hedge fund poses a restriction that the 1-day, 99% expected shortfall is $2 million. This statement implies that only 1% of the time, a single-day loss would be more than $2 million. While the VaR and expected shortfall interpretations are the same, the difference is in the way they are calculated. Expected Shortfall is more robust compared to VaR. With Expected Shortfall, a trader now can’t take up the $100 million risk since it would result in an expected shortfall much higher than the $2 million.

How to use VaR or expected shortfall for hedging using options?

After you have calculated the VaR or Expected Shortfall for your portfolio to determine the maximum amount of loss you're prepared to take, you can use options to limit your potential losses beyond the VaR or Expected Shortfall. For example, you could buy put options to protect against a decline in the value of your portfolio. If the value of your portfolio goes down, the value of your put options will go up, offsetting some of the losses.



Important note:

  1. Consider the cost of the options when hedging. Options come with a cost, so you must factor in this cost when deciding how much to hedge.
  2. Adjust your hedging strategy as necessary. As the value of your portfolio changes, your hedging needs will change too. You may need to adjust your options positions to maintain the desired level of protection.

    Overall, VaR and Expected Shortfall can help you determine how much risk you're willing to take on and how much protection you need using options to hedge against potential losses beyond your risk tolerance.



    Please let us know what you think of Quantra Classroom, and you can also take a free preview of the Options Trading Strategies In Python: Advanced course.



    Disclaimer:

    This post is for educational purposes only and is not a solicitation or recommendation to buy or sell any securities. Investing in stocks involves risks and you should seek the advice of a licensed financial advisor before making any investment decisions. Your investment decisions are solely your responsibility. The information provided is based on publicly available data and our own analysis, and we do not guarantee its accuracy or completeness. By no means is this communication posted as the licensed equity analysts or financial advisors and it should not be construed as professional advice or a recommendation to buy or sell any securities.