Python For Finance - Python, finance and getting them to play nicely together…
Python For Finance - Python, finance and getting them to play nicely together…
Trading Strategy Backtest

Moving Average Crossover Trading Strategy Backtest in Python – V 2.0

Welcome back…this post is going to deal with a couple of questions I received in the comments section of a previous post, one relating to a moving average crossover trading strategy – the article can be found here.

The questions I received at first asked whether the code for the backtest could be adapted to follow the following rules:

(1) If the short moving average crosses above the long moving average go long for x days.
(2) if the short moving average crosses below the long moving average short for x days.
(3a) If there is an additional crossover during holding period ignore it
(3b) If there are not crossovers hold cash

Continue reading

It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInEmail this to someonePin on PinterestShare on Reddit
December 18, 2016by s666

Share My Content

Archives

  • February 2018
  • October 2017
  • July 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • September 2016
  • July 2016
  • May 2016
  • April 2016
  • March 2016

Popular Posts

Investment Portfolio Optimisation with Python

Moving Average Crossover Trading Strategy Backtest in Python

Intraday Stock Mean Reversion Trading Backtest in Python With Short Selling

Scraping ETF data from the web and sticking it in an SQLite3 database

Bollinger Band Trading Strategy Backtest in Python

Blog Stats

  • 92,635 hits

Trading Strategy Posts

  • Bollinger Band Trading Strategy Backtest in Python

  • Intraday Stock Mean Reversion Trading Backtest in Python With Short Selling

  • Intraday Stock Mean Reversion Trading Backtest in Python

  • Optimisation of Moving Average Crossover Trading Strategy In Python

  • Moving Average Crossover Trading Strategy Backtest in Python – V 2.0

  • Analysis of Moving Average Crossover Strategy Backtest Returns Using Pandas

  • Moving Average Crossover Trading Strategy Backtest in Python

  • Python Backtesting Mean Reversion – Part 4

  • Python Backtesting Mean Reversion – Part 3

  • Python Backtesting Mean Reversion – Part 2

Recent Posts

Trading Strategy Analysis using Python and the FFN Package – Part 1

Stock Clusters Using K-Means Algorithm in Python

Stock Return Heatmap using Seaborn

Stochastic Oscillator Trading Strategy Backtest in Python

Bollinger Band Trading Strategy Backtest in Python

 

Privacy Policy