Foundations of technical analysis: Computational algorithms, statistical inference, and empirical implementation