A Volatility Trading System-Time Series Analysis in Python

Follow us on LinkedIn

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 NEWSYellen urging world leaders to ‘unlock’ frozen Russian Central Bank assets and send them to Ukraine
Yellen urging world leaders to ‘unlock’ frozen Russian Central Bank assets and send them to Ukraine

WASHINGTON (AP) — Treasury Secretary Janet Yellen is offering her strongest public support yet for the idea of liquidating roughly $300 billion in frozen Russian Central Bank assets and using them for Ukraine’s long-term reconstruction. “It is necessary and urgent for our coalition to find…

Stay up-to-date with the latest news - click here
LATEST NEWSScotiabank reports Q1 profit up from year ago, provisions for credit losses up
Scotiabank reports Q1 profit up from year ago, provisions for credit losses up

TORONTO — The Bank of Nova Scotia reported first-quarter net income of $2.20 billion, up from $1.76 billion a year earlier, even as the amount it put aside for bad loans rose compared with a year ago. The bank said Tuesday the profit amounted to…

Stay up-to-date with the latest news - click here
LATEST NEWSAthens taxis on a 48-hour strike that will coincide with a nationwide public sector stoppage
Athens taxis on a 48-hour strike that will coincide with a nationwide public sector stoppage

ATHENS, Greece (AP) — Taxi drivers in the Greek capital began a 48-hour strike Tuesday, with the second day timed to coincide with a nationwide strike by public and some private sector workers that is expected to disrupt public transport, ground some flights and leave…

Stay up-to-date with the latest news - click here
LATEST NEWSNordic countries are struggling to fly planes because Russian jamming is screwing with GPS: report
Nordic countries are struggling to fly planes because Russian jamming is screwing with GPS: report

Civilian and emergency service vehicles are experiencing frequent GPS issues in regions close to Russia.

Stay up-to-date with the latest news - click here
LATEST NEWSEnviroGold Global Announces Positive Initial Test Results with a Second Major Global Metal Production Company
EnviroGold Global Announces Positive Initial Test Results with a Second Major Global Metal Production Company

Test Results Demonstrate an Expansion of Applications for Proprietary Leach Technology TORONTO, Feb. 27, 2024 (GLOBE NEWSWIRE) — EnviroGold Global Limited (CSE: NVRO | OTCQB: ESGLF | FSE: YGK) (“EnviroGold Global” or the “Company”), develops and owns clean technology working to quickly supply society’s need…

Stay up-to-date with the latest news - click here

Leave a Reply