Blog

How to Get (Almost) Free Tick Data
PythonEducation

How to Get (Almost) Free Tick Data

Access to high quality, cost effective market data is a continuing problem for retail traders. I was recently told about the ongoing efforts of the startup brokerage “Alpaca”. The gentleman I spoke with said the API gave access to the tick data of thousands of stocks everyday and without cost. I thought it was too good to be true but recently I took a little bit of time to investigate. In this article I will describe the basic process to accessing the tick data, and some basic code I was exper

READ MORE
Mean Reversion Strategies in Python (Course Review)
EducationPython

Mean Reversion Strategies in Python (Course Review)

This post contains affiliate links. An affiliate link means Blackarbs may receive compensation if you make a purchase through the link, without any extra cost to you. Blackarbs strives to promote only products and services which provide value to my business and those which I believe could help you, the reader. In this post I will be reviewing the course “Mean Reversion Strategies by Dr. E.P. Chan” (<—affiliate link, use discount code LONGSHORT for an additional 5% off at checkout). First off, f

READ MORE
The Secret to Shorting Stocks
ResearchQuant

The Secret to Shorting Stocks

This post contains affiliate links. An affiliate link means Blackarbs may receive compensation if you make a purchase through the link, without any extra cost to you. Blackarbs strives to promote only products and services which provide value to my business and those which I believe could help you, the reader. Misinformation is everywhere. Many people believe the key to successful short selling is simply the inversion of a successful long strategy. I also used to believe this, among other short

READ MORE
Introducing the Take Profits Strategy Subscription
PythonEducation

Introducing the Take Profits Strategy Subscription

Before I address the topic of this post, I want to provide a little background context for the new initiatives of Blackarbs. If you want to skip to the offer just click this link. The Beginning I started my career in finance, fresh out of college in 2008/2009, at a proprietary trading shop. At that time, I had very little experience trading, but due to the referral of a good friend, in combination with my background in low-stakes no-limit hold-em poker, I was able to land the job. It was an e

READ MORE
Synthetic ETF Data Generation (Part-2) - Gaussian Mixture Models
PythonQuant

Synthetic ETF Data Generation (Part-2) - Gaussian Mixture Models

This post is a summary of a more detailed Jupyter (IPython) notebook where I demonstrate a method of using Python, Scikit-Learn and Gaussian Mixture Models to generate realistic looking return series. In this post we will compare real ETF returns versus synthetic realizations. To evaluate the similarity of the real and synthetic returns we will compare the following: * visual inspection * histogram comparisons * descriptive statistics * correlations * autocorrelations The data set we will

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

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

For newsletter subscribers this post is best viewed directly on my blog. Recap In Part 3 of the series we reviewed the relationship between returns and correlation of the 2-asset portfolio UPRO and TMF. The basic equal weight strategy was very compelling in terms of total return and CAGR. However, the strategy is susceptible to large drawdowns, especially in situations where US equities and long term bonds are out favor, for example in the 2015 and 2018 periods. We also went over some prototy

READ MORE
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