A Volatility Trading System-Time Series Analysis in Python

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],

If 10-day Moving Average (MA10) < 30-day Moving Average (MA30) Sell Short

If 10-day Moving Average (MA10) >= 30-day Moving Average (MA30) Cover Short

The system is implemented in Python. Graph below shows the MAs and VXX for the last 2 years.

Time Series Analysis in Python Moving Averages

VXX and Moving Averages

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.

Time Series Analysis in Python for Volatility Trading Strategies

Equity curve for VXX trading system

The strategy is profitable, and the moving averages help identify the trends.

References

[1] L. Connors, Buy the Fear, Sell the Greed: 7 Behavioral Quant Strategies for Traders, TradingMarkets Publishing, 2018

Further questions

What's your question? Ask it in the discussion forum

Have an answer to the questions below? Post it here or in the forum

LATEST NEWSHere's how the second-biggest bank collapse in U.S. history happened in just 48 hours
Here's how the second-biggest bank collapse in U.S. history happened in just 48 hours

As dust begins to settle on the biggest American bank failure since 2008, members of the VC community lament the role other investors played in SVB's demise.

Stay up-to-date with the latest news - click here
LATEST NEWSTrade Halt of the Shares of AcuityAds
Trade Halt of the Shares of AcuityAds

TORONTO and NEW YORK, March 10, 2023 (GLOBE NEWSWIRE) — AcuityAds Holdings Inc. (TSX:AT, Nasdaq: ATY) (“AcuityAds” or “Company”), a technology leader that provides targeted digital media solutions enabling advertisers to connect intelligently with audiences across advertising channels, announces that the trading of securities of…

Stay up-to-date with the latest news - click here
LATEST NEWSVanguard Says Retirees Can Add at Least $100k To Retirement Savings By Doing This
Vanguard Says Retirees Can Add at Least $100k To Retirement Savings By Doing This

Approximately 80% of all Americans aged 60 and older are homeowners, and housing wealth accounts for about 48% of the median wealth of that group. As retirees near large cities, and strong housing markets, start retiring, they realize they can unlock this wealth by selling…

Stay up-to-date with the latest news - click here
LATEST NEWSUS judge rules against Google, keeps DOJ advertising case in Virginia
US judge rules against Google, keeps DOJ advertising case in Virginia

ALEXANDRIA — A U.S. federal judge on Friday rejected a bid by Alphabet Inc’s Google to move a Justice Department lawsuit against it over dominance in advertising technology from Virginia to New York. “I am going to rule against you,” Judge Leonie Brinkema told an…

Stay up-to-date with the latest news - click here
LATEST NEWSMedalist Diversified REIT Announces Establishment of a Special Committee of the Board and Exploration of Strategic Alternatives
Medalist Diversified REIT Announces Establishment of a Special Committee of the Board and Exploration of Strategic Alternatives
Stay up-to-date with the latest news - click here

Leave a Reply