Momentum and reversal in financial markets with persistent heterogeneity