The dynamics of a stock market with heterogeneous agents is discussed in the framework of a recently proposed spin model for the emergence of bubbles and crashes. We relate the log returns of stock prices to magnetization in the model and find that it is closely related to trading volume as observed in real markets. The cumulative distribution of log returns exhibits scaling with exponents steeper than 2 and scaling is observed in the distribution of transition times between bull and bear markets.