``Negativity effect'' refers to the psychological phenomenon that people tend to attach greater weight to negative information than to equally extreme and equally likely positive information in a variety of information processing tasks. Numerous studies of impression formation have found that negative information is weighted more heavily than positive information as impressions of others are formed. There is empirical evidence in political science that shows the importance of the negativity effect in the information processing of the voters. This effect can explain the observed decrease of popularity for a president the longer he is in office. \\ We construct a dynamic model of political competition, incorporating the negativity effect in the decision rule of the voters and allowing their preferences to change over time, according to the past performance of the candidates while in office. Our model may explain the emergence of ideologies out of the competition for votes of myopic candidates freely choosing policy positions. This result gives rise to the formation of political parties, as infinitely--lived agents with a certain ideology. Furthermore, in this model some voters may start out by switching among parties associated with different policies, but find themselves supporting one of the parties from some point on. Thus, the model describes a process by which some voters become identified with a ``right'' or ``left'' bloc, while others ``swing'' between the two parties.