Book Image

Mastering Python for Finance

Book Image

Mastering Python for Finance

Overview of this book

Table of Contents (17 chapters)
Mastering Python for Finance
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

VaR for risk management


As soon as we open a position in the market, we are exposed to various types of risks, such as volatility risk and credit risk. To preserve our trading capital as much as possible, it is important to incorporate some form of risk management measures to our trading system.

Perhaps the most common measure of risk used in the financial industry is the VaR technique. It is designed to simply answer: what is the worst expected amount of loss, given a specific probability level, say 95 percent, over a certain period of time? The beauty of VaR is that it can be applied to multiple levels, from position-specific micro level to portfolio-based macro level. For example, a VaR of $1 million with a 95 percent confidence level for a one-day time horizon states that on average, only 1 day out of 20 would you expect to lose more than $1 million due to market movements.

The following figure illustrates a normally distributed portfolio returns with a mean of 0 percent, where VaR is...