Cointegration, Pairs Trading

Cointegration suggests a long-term equilibrium relationship between the prices of stock pairs.
Studying how to make profit from two correlated stocks
Example: Coca Cola and PepsiCo

from statsmodels.tsa.stattools import coint # use this library to find this out the p_value  

Arbitrage

Cross-trading between two stocks, no additional investment
Little to no risk, positive profit, quickly disappears

Signals based on z score from rolling mean and std

Assumption that the stocks will follow movement with each other

Increasing trade frequency (decreasing time range) when z-score is extremely high

Sources: