Generalized minority games with adaptive trend-followers and contrarians