Cointegration
Cointegration occurs when two or more nonstationary time series have a linear combination that is stationary. In simpler terms, although the prices of two assets move in a non-stationary (trend) manner, their "distance" or relationship tends to remain stable over time.
One of the ways to test for cointegration is the Engle-Granger test.
Steps of the Engle-Granger Test: first, a linear regression is performed between the two assets; a unit root test is applied to the residuals: if the residuals are stationary, it means the series are cointegrated.
If the p-value < 0.05: the residuals are stationary and therefore the two series are cointegrated.
If p-value > 0.05: the residuals are not stationary and the two series are not cointegrated.
Some things to consider: cointegrating relationship may change over time; requires a long enough time horizon; cointegrated assets may offer hedging opportunities; when moving away from the average relationship there may be trading opportunities.