We introduce a hybrid discrete choice framework to model the decisions of investors in stock markets. More specifically, we model the decision to buy or sell stocks using a binary logit model with latent classes, characterizing the perception of risk. The model considers the dynamic nature of the underlying decision process and is estimated from the data of a Swiss bank containing 25989 transactional observations from January 2005 to September 2010 for 6 different portfolios. The predictive performance of the model is tested: a cross-validation analysis is performed and the forecasting accuracy of the model is studied in details. Parameters of the model are interpretable and quantify interesting behavioral mechanisms related to investors decisions. The predictive capabilities of the model in a real context makes it practicable.