Introduction

Pairs trading is perhaps the earliest form of relative value quantitative trading in equities. Using some modern Machine Learning tools in the pair trading investment process, we will show how to create sensible pairs without using any price data.

Certain stocks have highly related price series because they:

  • operate in similar business lines

Therefore, if we could read about and understand the business of each company and then link up companies based on this understanding, we should have a…


Introduction

In developing a Pairs Trading strategy, finding valid, eligible pairs that exhibit unconditional mean-reverting behavior is of critical importance. We walk through an example implementation of finding eligible pairs and then perform a backtest on a selected pair. We show how popular algorithms from Machine Learning can help us navigate a very high-dimensional search space to find tradable pairs.

Jupyter Notebooks are available on Google Colab and Github.

For this project, we use several Python-based scientific computing technologies listed below.

import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
import pandas as pd
from sklearn.cluster import KMeans…


Introduction

This example employs several unsupervised learning techniques in scikit-learn to extract the stock market structure from variations in historical close prices. The quantity that we use is the daily variation in close prices because prices that are linked tend to cofluctuate during a day.

Jupyter Notebooks are available on Google Colab and Github.

For this project, we use several Python-based scientific computing technologies listed below.

import requests
import numpy as np
import pandas as pd
import pymc3 as pm
import theano as th
import seaborn as sns
import matplotlib.cm as cm
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
from…


Introduction

This article covers regression analysis, which is fundamental to many applications of machine learning and throughout scientific disciplines. We will walk through some of the concepts and then dig into some regression examples using financial data from AlphaWave Data.

Jupyter Notebooks are available on Google Colab and Github. For this analysis, we use several Python-based scientific computing technologies listed below.

#Import Libraries
import math
import time
import requests
import numpy as np
import pandas as pd
from scipy import stats
import plotly.express as px
import plotly.graph_objects as go
from datetime import datetime, timedelta
from sklearn.linear_model import LinearRegression

Regression: a branch of supervised learning

In the context…


This article aims to introduce users to basic ML concepts and lay the foundation for future learning and exploration of ML. We will discuss common ML terminology and then cover three Python packages that are used in ML. The article concludes with additional resources for self-study.

Terminology

Jargon is one of the first obstacles for beginners in ML. This section explains some of the most common terms you need to be familiar with.

Statistics versus Machine Learning

Statistical approaches and ML techniques both analyze observations to reveal some underlying process; however, they diverge in their assumptions, terminology, and techniques. Statistical approaches rely on foundational assumptions…


Instruction, media content, examples, and links to resources that will help you build a foundation for Python competency. Jupyter Notebooks are available on Google Colab and Github.

Modules

Web Resources
Docs.python.org — Packages

What are Python Modules?

Modules are simply Python files (.py) that contain Python code. This code can define functions, classes, variables, etc.

Why do we use Modules?

Modules allow us to organize our code by grouping related functionalities, which makes it easier to use and understand. Writing code into smaller, more manageable pieces will help you 1) debug easier, 2) create reusable code and 3) make the code more understandable to the end-user.

How do we use Modules?

We can use the…


What is a Python Class?

A class is a user-defined blueprint or prototype from which objects are created.

Why do we use Classes?

Classes provide a means of bundling data and functionality together. Creating a new class creates a new type of object, allowing new instances of that type to be made. Each class instance can have attributes attached to it for maintaining its state. Class instances can also have methods (defined by its class) for modifying its state.

To understand the need for creating a class, let’s consider an example. Let’s say you wanted to track the number of dogs which may have different attributes like breed and age…


Instruction, media content, examples, and links to resources that will help you build a foundation for Python competency. Jupyter Notebooks are available on Google Colab and Github.

Web Resources
Docs.python.org — Reading and Writing Files

What is I/O?

I/O, or input/output, is communication between a computer and the outside world.

Inputs are signals received by the computer. The computer can get inputs from hardware like a keyboard and mouse or from other computers via the internet. Outputs are signals sent by the computer. Your monitor is probably the most obvious output device. …


Instruction, media content, examples, and links to resources that will help you build a foundation for Python competency. Jupyter Notebooks are available on Google Colab and Github.

Web Resources
Docs.python.org — Functions
Docs.python.org — More on Functions

What are Python Functions?

A function is a block of organized, reusable code that is used to perform a single, related action.

Why do we use Functions?

Functions provide better modularity for your application and a high degree of code reusing.

Python gives you many built-in functions like print(), etc. but you can also create your own functions. These functions are called user-defined functions.

How do we create Functions?

You can define functions to provide the required…


Instruction, media content, examples and links to resources that will help you build a foundation for Python competency. Jupyter Notebooks are available on Google Colab and Github.

Web Resources
Docs.python.org — Control Flow
Docs.python.org — Looping Techniques

What are Python Loops?

In the real world, you often need to repeat something over and over. It can be repetitive. When programming, though, if you need to do something 100 times, you certainly don’t need to write it out in 100 identical lines of code. In Python, loops allow you to iterate over a sequence, whether that’s a list, tuple, string, or dictionary.

What types of Python Loops are there?

There is a…

Hugh Donnelly

Hugh co-founded AlphaWave Data in 2020 and is responsible for risk, attribution, portfolio construction, and investment solutions.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store