The understanding of complex social or economic systems is an important scientific challenge. Here we present a comprehensive study of the Spanish Stock Exchange showing that most financial firms trading in that market are characterized by a resulting strategy and can be classified in groups of firms with different specialization. Few large firms overally act as trending firms whereas many heterogeneous firm act as reversing firms. The herding properties of these two groups are markedly differen...