Imitation and stability in a stock market