In the previous post, we presented a system for trading VXX, a volatility Exchange Traded Note. The trading system was built based on simple moving averages. In this post, we are going to examine the time series properties of VXX in more details. The figure below shows the VXX and its 200-day moving average for the last 5 years. From the Figure, it’s evident that the time series has a strong downward drift. The cause of this downward drift has been discussed to a great extent in the investment community. It will not be a subject of this post. Next, we calculate the daily returns of VXX and perform the Augmented Dickey-Fuller test to check the stationarity of the return series. According to Wikipedia,
We utilize Python to run ADF test on the return series. The test statistic is -19.5 and the p-value is zero. Therefore the return series is stationary. We then proceed to examine the autocorrelation functions of VXX returns.
The plot below shows the autocorrelation (ACF) and partial autocorrelation (PACF) functions of VXX returns. It’s interesting to note that VXX returns are positively auto-correlated at 3-day lag. It’s well-known that the stock indices are mean reverting in the short term. Here we observe the opposite, i.e. a trending property. Click on the link below to download the Python program and data file. Post Source Here: Stationarity and Autocorrelation Functions of VXX-Time Series Analysis in Python
0 Comments
Time series analysis is an important subject in finance. In this post, we are going to apply a time series technique to a financial time series and develop an investment strategy. Specifically, we are going to use moving averages to trade volatility Exchange Traded Notes (ETN). Moving averages are used on financial time series data to smooth out short-term noises and identify longer-term trends. We apply them to VXX, a volatility ETN. Note that VXX *Launched in 2009**Enables investors to bet on the size of swings in the S&P 500 Index (SPX)**Used by individual investors and hedge fund managers alike**Peaked at $2 billion under management in Feb. 2018, now $800 million**Structured as a debt instrument with a maturity date of Jan. 30, 2019*-
*Was replaced by the VXXB, which has other features.**Read more*
The trading rules are as follows [1],
The system is implemented in Python. Graph below shows the MAs and VXX for the last 2 years. [caption id="attachment_654" align="aligncenter" width="540"] VXX and Moving Averages[/caption] The position size is $10000; leverage is not utilized, and profit is not compounded. Graph below shows the equity curve for the trading strategy from January 2009 to January 2019. [caption id="attachment_655" align="aligncenter" width="564"] Equity curve for VXX trading system[/caption] Click on the link below to download the Python program and data file.
[1] L. Connors,
Post Source Here: A Volatility Trading System-Time Series Analysis in Python When trading options, we often use the VIX index as a measure of volatility to help enter and manage positions. This works most of the time. However, there exist some differences between the VIX index and at-the-money implied volatility (ATM IV). In this post, we are going to show such a difference through an example. Specifically, we study the relationship between the implied volatility and forward realized volatility (RV) [1] of SP500. We utilize data from April 2009 to December 2018. Recall that the VIX index - Is a model-independent measure of volatility,
- It contains a basket of options, including out-of-the-money options. Therefore it incorporates the skew effect to some degree.
Plot below shows RV as a function of the VIX index. We observe that a high VIX index will usually lead to a higher realized volatility. The correlation between RV and the VIX is 0.6397. For traders who manage fixed-strike options, the use of option-specific implied volatilities, in conjunction with the VIX index, should be considered. In this example, we calculate the one-month at-the-money implied volatility using SPY options. Unlike the VIX index, the fixed-strike volatilities are model-dependent. To simplify, we use the Black-Scholes model to determine the fixed-strike, fixed-maturity implied volatilities. The constant-maturity, floating-strike implied volatilities are then calculated by interpolation. Plot below shows RV as a function of ATM IV. We observe similar behaviour as in the previous plot. However, the correlation (0.5925) is smaller. This is probably due to the fact that ATM IV does not include the skew. In summary: - There are differences between the VIX index and at-the-money implied volatility.
- Higher implied volatilities (as measured by the VIX or ATM IV) will usually lead to higher RV.
[1] In this example, forward realized volatility is historical volatility shifted by one month. Source Here: Differences Between the VIX Index And At-the-Money Implied Volatility In previous posts, we provided examples of pricing European and American options in Excel. For pricing the European option, we utilized the Black-Scholes formula, and for pricing the American option we utilized the binomial approach. In this post, we are going to implement these methods in Python. Recall that,
We use the same input parameters as in the previous examples. The main input parameters are as follows, Figure below shows the results calculated by the Python program. The Python program returns the same values as the Excel workbooks. Click on the link below to download the Python program. Post Source Here: Valuation of European and American Options-Derivative Pricing in Python In a previous post, we presented an example of Interest Rate Swap Pricing in Excel. In this post, we are going to provide an example of interest rate swap pricing in Python. We are going to use the USD Libor swap curve as at December 31 2018. Picture below shows the swap curve. [caption id="attachment_630" align="aligncenter" width="628"] USD Swap Curve as at Dec 31, 2018. Source: Bloomberg[/caption] Recall that an interest rate swap (IRS) is a financial derivative instrument that involves an exchange of a fixed interest rate for a floating interest rate. More specifically,
The valuation of an interest rate swap proceeds as follows, - Construction of the zero-coupon curve
- Determination of the payment schedules
- Calculation of the net present value of future cash flows
The hypothetical interest rate swap is as follows,
Note that we utilize the deposit and swap rates only and ignore the futures prices in the bootstrapping process. The values of the fixed, floating legs and the interest rate swap are calculated using a Python program. We obtain the following result Click on the link below to download the Python program. Originally Published Here: Interest Rate Swap-Derivative Pricing in Python In this post, we are going to walk you through an example of calculating the weighted average cost of capital (WACC) using Excel.
For illustration purposes, we are going to calculate the WACC of Barrick Gold, a major Canadian mining company. [caption id="attachment_613" align="aligncenter" width="628"] Barrick Gold as at January 25 2019. Source: Stockchart.com[/caption] The WACC is calculated as follows,
where To calculate the
Table below shows the calculation for the cost of equity as at September 30, 2018, As for the Finally, we proceed to calculate the WACC. Table below shows the calculation steps and results, Click on the link below to download the Excel workbook which contains detailed calculation steps and references. Originally Published Here: Weighted Average Cost of Capital (WACC)-Business Valuation Calculator in Excel A lot of research has been devoted to answering the question: do options price in the volatility risks correctly? The most noteworthy phenomenon (or bias) is called the volatility risk premium, i.e. options implied volatilities tend to overestimate future realized volatilities. Much less attention is paid, however, to the underlying asset dynamics, i.e. to answering the question: do options price in the asset dynamics correctly? Note that within the usual BSM framework, the underlying asset is assumed to follow a GBM process. So to answer the above question, it’d be useful to use a different process to model the asset price. We found an interesting article on this subject [1]. Instead of using GBM, the authors used a process where the asset returns are auto-correlated and then developed a closed-form formula to price the options. Specifically, they assumed that the underlying asset follows an MA(1) process, where β represents the impact of past shocks and After applying some standard pricing techniques, a closed-form option pricing formula is derived which is similar to BSM except that the variance (and volatility) contains the autocorrelation coefficient, From the above equation, it can be seen that - When the underlying asset is mean reverting, i.e. β<0, which is often the case for equity indices, the MA(1) volatility becomes smaller. Therefore if we use BSM with σ as input for volatility, it will overestimate the option price.
- Conversely, when the asset is trending, i.e. β>0, BSM underestimates the option price.
- Time to maturity, τ, also affects the degree of over- underpricing. Longer-dated options will be affected more by the autocorrelation factor.
[1] Liao, S.L. and Chen, C.C. (2006), Original Post Here: Is Asset Dynamics Priced In Correctly by Black-Scholes-Merton Model? Debt instruments are an important part of the capital market. In this post, we are going to provide an example of pricing a fixed-rate bond.
We are going to price a hypothetical bond as at October 31, 2018. We first build a zero coupon curve. Picture below shows the market rates as at the valuation date. [caption id="attachment_595" align="aligncenter" width="628"] US swap curve as at Oct 31 2018[/caption] We utilize the deposit rates (leftmost column) to construct the zero curve up to 12-month maturity. We then use this zero curve to price the following hypothetical fixed rate bond:
We use Python [1] to build a bond pricer. Picture below shows the result returned by the Python program. The price is $99.94 (per $100 notional). Click on the link below to download the python code.
[1] Post Source Here: Valuing a Fixed Rate Bond-Derivative Pricing in Python In a previous post entitled Credit Risk Management Using Merton Model we provided a brief theoretical description of the Merton structural credit risk model. Note that,
In this installment, we are going to present a case study based upon the Merton credit risk model. [caption id="attachment_588" align="aligncenter" width="628"] Junior Gold Miners ETF as at Nov 28 2018. Source: stockcharts.com[/caption] Our Client is a junior gold miner. They are looking to raise additional capital in order to finance the production of gold. The client currently has an outstanding liability in the form of future discount for the payment of deliverable gold. According to a contingency clause, the Buyer can exercise a certain amount of cash into a secured obligation. This conversion will increase the leverage of the Company, thus leading to higher credit risks. We determined the increase in the credit risks by using the Merton structural credit model. We estimated that if the Buyer exercises the cash conversion clause, the credit spread of the Client will increase by approximately 20%. We thus helped the Client better negotiate the deal with their counterparty. Originally Published Here: Merton Credit Risk Model, a Case Study An interest rate swap (IRS) is a financial derivative instrument that involves an exchange of a fixed interest rate for a floating interest rate. More specifically,
The above description refers to a plain vanilla IRS. However, interest rate swaps can come in many different flavors. These include, (but are not limited to) - Amortizing notional IRS
- Cross-currency swap
- Float-for-float (basis) swap
- Overnight index swap
- Inflation swap etc.
Interest rate swaps are often used to hedge the fluctuation in the interest rate. To value an IRS, fixed and floating legs are priced separately using the discounted cash flow approach. Below is an example of a hypothetical plain vanilla IRS
The values of the fixed, floating legs and the IRS are calculated using an Excel spreadsheet. Table below presents their values Click on the link below to download the Excel spreadsheet. Article Source Here: Interest Rate Swap-Derivative Pricing in Excel |