Trading Strategy Backtest

Staying on the same topic of optimisation that we visited in the last post concerning portfolio holdings and efficient frontiers/portfolio theory, I thought I would quickly revisit the moving average crossover strategy we built a few posts ago; the previous article can be found here. Optimisation of Moving Average Crossover Trading Strategy In Python In…Continue Reading “Optimisation of Moving Average Crossover Trading Strategy In Python”

Trading Strategy Backtest

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…Continue Reading “Moving Average Crossover Trading Strategy Backtest in Python – V 2.0”

Trading Strategy Backtest

In this post I thought I’d take advantage of the results we got from the moving average crossover strategy backtest in the last post (can be found here), and spend a bit of time digging a little more deeply into the equity curve and producing a bit of analysis concerning some key performance indicators and…Continue Reading “Analysis of Moving Average Crossover Strategy Backtest Returns Using Pandas”

Trading Strategy Backtest

Hi all, for this post I will be building a simple moving average crossover trading strategy backtest in Python, using the S&P500 as the market to test on. A simple moving average cross over strategy is possibly one of, if not the, simplest example of a rules based trading strategy using technical indicators so I…Continue Reading “Moving Average Crossover Trading Strategy Backtest in Python”

Trading Strategy Backtest

I thought I’d finish off this short series of Python Backtesting Mean Reversion by providing a full, executable script that incorporates the use of SQL queries to extract our ticker symbols from the SQLite database we created in an earlier post (This can be found here) In this particular example I have decided to run…Continue Reading “Python Backtesting Mean Reversion – Part 4”

Trading Strategy Backtest

Welcome back everyone, finally I have found a little time to get around to finishing off this short series on Python Backtesting Mean Reversion strategy on ETF pairs. In the last post we got as far as creating the spread series between the two ETF price series in question (by first running a linear regression…Continue Reading “Python Backtesting Mean Reversion – Part 3”

Trading Strategy Backtest

Hi all, welcome back. This blog post is going to deal with creating the initial stages of our Python backtesting mean reversion script – we’re going to leave the “symbol pairs” function we created in the last post behind for a bit (we’ll come back to it a bit later) and use a single pair…Continue Reading “Python Backtesting Mean Reversion – Part 2”

Trading Strategy Backtest

Right, welcome back and sorry for the slight delay between posts…I’ve been way more busy than I had hoped. Onto our python backtesting! So this, I guess, could be considered the first proper post regarding the ETF mean reversion backtest script we’re trying to come up with. In the last post we went over creating…Continue Reading “Python Backtesting – ETF Mean Reversion – creating the ticker pairs”

Trading Strategy Backtest

SQLite database python web scrape… As promised, here is the first part of my “ETF mean reversion strategy backtest” series. This article deals with scraping ETF data from the web and sticking it in an SQLite3 database. I’m using SQLite as it’s very easy to set up, and requires nothing complex to get up and…Continue Reading “Scraping ETF data from the web and sticking it in an SQLite3 database”

Trading Strategy Backtest

Python Mean Reversion Backtest for ETFs… I have been looking into using Python to create a backtesting script to test mean reversion strategies based on cointegrated ETF pairs. I have broken down the process in my head into several stages, each of which will form the basis of my next few blog posts. I’m not…Continue Reading “Python Mean Reversion Backtest for ETFs”