In this paper, we propose a pairs trading strategy using the theory of topological data analysis (TDA). The proposed strategy is model-free. We propose a TDA-based distance to measure dependence between a pair of stochastic processes. We derive an upper bound of this distance in terms of a function of the canonical correlation of the processes, which allows for interpretability of this distance. We also study Karhunen-Loeve expansions of certain processes to qualitatively explore their shape properties. We check the performance of the strategy on simulated data from correlated geometric Brownian motion, correlated Ornstein-Uhlenbeck process and DCC-GARCH. We also examine the profitability of the proposed strategy on high-frequency data from the National Stock Exchange of India in 2018. We compare the method to a Euclidean distance-based method for pairs trading. We propose a pairs trading strategy evaluation framework using a Bayesian model for comparing gains from these two strategies. We find that the proposed approach based on TDA is more profitable and trades more frequently than the Euclidean distance-based strategy.