A pairs trade is a market neutral trading strategy enabling traders to profit from virtually any market conditions.

Overview

Quantitative Finance - Pairs Trading

A pairs trade relies on the fact that - if the correlation between two stocks is atleast 95% they follow a similar trend. But due to temporary market conditions like the announcement of results in a company or due to mishaps in another company, the stock direction of that company may deviate from the mean value.
Given the striking similarities between the two banks used for this capstone, a change in the business environment of one bank, affects the paired bank in a similar manner. However because of a high correlation, the deviated stock tries to return to the mean path. Pairs trading is a market neutral strategy wherein when one stock is bought, another is sold short.
We exercise this opportunity when the stock deviates from its expected trend and should enter the trade if the standard deviation exceeds 95%.

Linear Regression

Linear regression is a statistical operation wherein the input is an array of two sets of numbers and the output contains different parameters, including the intercept and constant needed for constructing the straight line equation.
Linear regression analyzes two separate variables in order to define a single relationship. In price-action analysis, this refers to the variables of price and time. Quantitative traders who use charts recognize the ups and downs of price printed horizontally from day-to-day, minute-to-minute, or week-to-week, depending on the evaluated time frame. The different time frame approaches are what make linear regression analysis so attractive.

References

Logic behind Pairs Trading: https://zerodha.com/varsity/chapter/pair-trading-basics/
Density curves in equity: https://mintpaisa.com/procedure-of-executing-pair-trade/
Error Ratio computation: https://zerodha.com/varsity/chapter/the-error-ratio/
Correlation and Cointegration: https://blog.quantinsti.com/pairs-trading/#cointegration
Z-Score relevance: https://medium.com/auquan/pairs-trading-data-science-7dbedafcfe5a

You might also like...
An unofficial python API for trading on the DeGiro platform, with the ability to get real time data and historical data.

DegiroAPI An unofficial API for the trading platform Degiro written in Python with the ability to get real time data and historical data for products.

Stocks Trading News Alert Using Python

Stocks-Trading-News-Alert-Using-Python Ever Thought of Buying Shares of your Dream Company, When their stock price got down? But It is not possible to

Python scripts to interact with Upper Deck ePack online trading card platform

This script should connect to the Upper Deck ePack API using your browser cookies and download a list of your current collection and save it as a CSV.

Senator Stock Trading Tester

Senator Stock Trading Tester Program to compare stock performance of Senator's transactions vs when the sale is disclosed. Using to find if tracking S

Tool to generate wrappers for Linux libraries allowing for dlopen()ing them without writing any boilerplate

Dynload wrapper This program will generate a wrapper to make it easy to dlopen() shared objects on Linux without writing a ton of boilerplate code. Th

a simple proof system I made to learn math without any mistakes

math_up a simple proof system I made to learn math without any mistakes 0. Short Introduction test yourself, enjoy your math! math_up is an NBG-based,

A Regex based linter tool that works for any language and works exclusively with custom linting rules.

renag Documentation Available Here Short for Regex (re) Nag (like "one who complains"). Now also PEGs (Parsing Expression Grammars) compatible with py

Repo created for the purpose of adding any kind of programs and projects

Programs and Project Repository A repository for adding programs and projects of any kind starting from beginners level to expert ones Contributing to

Owner
Kanupriya Anand
Kanupriya Anand
Originally used during Marketplace.tf's open period, this program was used to get the profit of items bought with keys and sold for dollars.

Originally used during Marketplace.tf's open period, this program was used to get the profit of items bought with keys and sold for dollars. Practically useless for me now, but can be used as an example of tkinter.

BoggoTV 1 Dec 11, 2021
A Non profit app built on top of Frappe framework & ERPNext

Non Profit A Non profit app built on top of Frappe framework & ERPNext. People who change the world need the tools to do it! The Non Profit Modules of

Frappe 16 Nov 17, 2022
ChronoRace is a tool to accurately perform timed race conditions to circumvent application business logic.

ChronoRace is a tool to accurately perform timed race conditions to circumvent application business logic. I've found in my research that w

Tanner 64 Aug 4, 2022
Aerospace utilities: flight conditions package, standard atmosphere model, and more.

Aerospace Utilities About Module that contains commonly-used aerospace utilities for problem solving. Flight Condition: input altitude to compute comm

null 1 Jan 3, 2022
Laurence Billingham 1 Feb 16, 2022
Building an Investment Portfolio for Day Trade with Python

Montando um Portfólio de Investimentos para Day Trade com Python Instruções: Para reproduzir o projeto no Google Colab, faça o download do repositório

Paula Campigotto 9 Oct 26, 2021
Hacktoberfest2021 🥳- Contribute Any Pattern In Any Language😎 Every PR will be accepted Pls contribute

✨ Hacktober Fest 2021 ✨ ?? All Contributors are requested to star this repo and follow me for a successful merge of pull request. ?? ?? Add any patter

Md. Almas Ali 103 Jan 7, 2023
Python: Wrangled and unpivoted gaming datasets. Tableau: created dashboards - Market Beacon and Player’s Shopping Guide.

Created two information products for GameStop. Using Python, wrangled and unpivoted datasets, and created Tableau dashboards.

Zinaida Dvoskina 2 Jan 29, 2022
Estimate the Market Size for Electic and Plug-In Hybrid Vehicles In Africa

Estimate the Market Size for Electic and Plug-In Hybrid Vehicles In Africa The goal of this repository is to use open data repositories to answer the

Leonce Nshuti 0 Feb 21, 2022
IG Trading Algos and Scripts in Python

IG_Trading_Algo_Scripts_Python IG Trading Algos and Scripts in Python This project is a collection of my work over 2 years building IG Trading Algorit

null 191 Oct 11, 2022