Blog

A Dead Simple 2-Asset Portfolio that Crushes the S&P500 (Part 3)
PythonQuant

A Dead Simple 2-Asset Portfolio that Crushes the S&P500 (Part 3)

Recap This is an update to the original blog series that explored a simple strategy of being long UPRO and TMF in equal weight, inverse volatility and inverse-inverse volatility. This strategy crushed the cumulative and risk-adjusted returns of the benchmark SPY etf. However through our research we determined that this strategy is heavily dependent on the correlation between the two assets. This strategy works best when correlations are positive and prices are trending positively, however, theo

READ MORE
Synthetic Data Generation (Part-1) - Block Bootstrapping
PythonQuant

Synthetic Data Generation (Part-1) - Block Bootstrapping

Outline * Introduction * An Alternative Solution? * Notebook Description and Links * Conclusions * Future Work * Resources and Links Introduction Data is at the core of quantitative research. The problem is history only has one path. Thus we are limited in our studies by the single historical path that a particular asset has taken. In order to gather more data, more asset data is collected and at higher and higher resolutions, however the main problem still exists; one historical path

READ MORE
Download Intraday Stock Data with IEX and Parquet
Pythondata

Download Intraday Stock Data with IEX and Parquet

Post Outline * Why IEX? * Why Parquet? * System Outline * Code * Links WHY IEX? IEX is a relatively new exchange (founded in 2012). For our purposes, what makes them different from other exchanges is they provide a robust FREE API to query their stock exchange data. As a result we can leverage the pandas-datareader framework to query IEX data quite simply. WHY PARQUET? I don't use Hadoop, however Parquet is a great storage format within the pandas ecosystem as well. It is fast, s

READ MORE
Labeling and Meta-Labeling Returns for ML Prediction
EducationPython

Labeling and Meta-Labeling Returns for ML Prediction

Post Outline * Introduction * Links * Embedded Notebook INTRODUCTION This post focuses on Chapter 3 in the new book Advances in Financial Machine Learning by Marcos Lopez De Prado. In this chapter De Prado demonstrates a workflow for improved return labeling for the purposes of supervised classification models. He introduces multiple concepts but focuses on the Triple-Barrier Labeling method, which incorporates profit-taking, stop-loss, and holding period information, and also meta-labeli

READ MORE
Exploring Alternative Price Bars
PythonQuant

Exploring Alternative Price Bars

Post Outline * Introduction * Links * Embedded Notebook Introduction This post explores a concept at the heart of quantitative financial research. Most qfin researchers utilize statistical techniques that require varying degrees of stationarity. As many of you are aware financial time series violate pretty much all the rules of stationarity and yet many researchers, including me, have applied or will apply techniques when not appropriate thereby calling into question many of the resulting

READ MORE
Mixture Model Trading (Part 5 - Algorithm Evaluation with pymc3)
PythonQuant

Mixture Model Trading (Part 5 - Algorithm Evaluation with pymc3)

Post Outline * Recap * Chapter Goals and Outline * Links * Embedded Jupyter Notebook Recap See <Mixture Model Trading (Part 1, Part 2, Part 3, Part 4, Part 5, Github Repo)>. This research demonstrates a systematic trading strategy development workflow from theory to implementation to testing. It focuses on the concept of using Gaussian Mixture Models as a method for return distribution prediction and then using a simple market timing strategy to take advantage of the predicted asset retu

READ MORE
Mixture Model Trading (Part 4 - Strategy Implementation)
PythonQuant

Mixture Model Trading (Part 4 - Strategy Implementation)

Post Outline * Chapter Goals and Outline * Links * Introduction * Mixture Model Trading Algorithm Outline * GMM Algorithm Implementation * Next Steps Chapter Goals and Outline * Use Part 3 - strategy research as a basis for algorithmic trading strategy. * Implement strategy using the Quantconnect platform. Links * Mixture Model Trading Github Repo * Part 4 Jupyter Notebook Link * Full Algorithm Python Script Introduction This notebook will walkthrough the algorithm implement

READ MORE
Mixture Model Trading (Part 3 - Strategy Research)
PythonQuant

Mixture Model Trading (Part 3 - Strategy Research)

Post Outline * Introduction * Links * Notebook * Next Steps Introduction This is the beginning of a three part series that I completed towards the end of 2017 as a learning module for Quantinsti.com. The purpose of the series is to demonstrate a research workflow focused around the theory and application of mixture models as the core framework behind a algorithmic trading strategy. Below is a quote taken from the README of the github repo: “The primary goal of this repo is to demonstrat

READ MORE
Mixture Model Trading (Part 2 - Gaussian Mixtures)
PythonQuant

Mixture Model Trading (Part 2 - Gaussian Mixtures)

Post Outline * Introduction * Links * Notebook * Next Steps Introduction This is the beginning of a three part series that I completed towards the end of 2017 as a learning module for Quantinsti.com. The purpose of the series is to demonstrate a research workflow focused around the theory and application of mixture models as the core framework behind a algorithmic trading strategy. Below is a quote taken from the README of the github repo: “The primary goal of this repo is to demonstrat

READ MORE
Mixture Model Trading (Part 1 - Motivation)
PythonQuant

Mixture Model Trading (Part 1 - Motivation)

Post Outline * Introduction * Links * Notebook * Next Steps Introduction This is the beginning of a three part series that I completed towards the end of 2017 as a learning module for Quantinsti.com. The purpose of the series is to demonstrate a research workflow focused around the theory and application of mixture models as the core framework behind a algorithmic trading strategy. Below is a quote taken from the README of the github repo: I will be presenting each of the notebooks

READ MORE
Computing Option Skews with Dask
ResearchQuant

Computing Option Skews with Dask

Post Outline * Introduction * Links + Datasets * Notebook * Next Steps Introduction This article series provides an opportunity to move towards more interactive analysis. My plan is to integrate more Jupyter notebooks and Github repos into my research/publishing workflow. For datasets that are too big to share through github I will provide a download link both here and in the github readme. I will be posting the notebooks into this blog using iframes. If you experience any issues with f

READ MORE
How To Get Free Intraday Options Data With Pandas-DataReader
PythonResearch

How To Get Free Intraday Options Data With Pandas-DataReader

Post Outline * Purpose * Intuitive explanation * Code * Next Steps Purpose This is a simple reference article for readers that might wonder where I get/got my options data from. In this regard I would like to shout out the contributors to the pandas-datareader, without their efforts this process would be much more complex. Intuitive Explanation So this code consists of three components. The first is the actual script that wraps the pandas-datareader functions and downloads the options

READ MORE