  Background: For complex financial systems, the negative and positive
return-volatility correlations, i.e., the so-called leverage and anti-leverage
effects, are particularly important for the understanding of the price
dynamics. However, the microscopic origination of the leverage and
anti-leverage effects is still not understood, and how to produce these effects
in agent-based modeling remains open. On the other hand, in constructing
microscopic models, it is a promising conception to determine model parameters
from empirical data rather than from statistical fitting of the results.
  Methods: To study the microscopic origination of the return-volatility
correlation in financial systems, we take into account the individual and
collective behaviors of investors in real markets, and construct an agent-based
model. The agents are linked with each other and trade in groups, and
particularly, two novel microscopic mechanisms, i.e., investors' asymmetric
trading and herding in bull and bear markets, are introduced. Further, we
propose effective methods to determine the key parameters in our model from
historical market data.
  Results: With the model parameters determined for six representative
stock-market indices in the world respectively, we obtain the corresponding
leverage or anti-leverage effect from the simulation, and the effect is in
agreement with the empirical one on amplitude and duration. At the same time,
our model produces other features of the real markets, such as the fat-tail
distribution of returns and the long-term correlation of volatilities.
  Conclusions: We reveal that for the leverage and anti-leverage effects, both
the investors' asymmetric trading and herding are essential generation
mechanisms. These two microscopic mechanisms and the methods for the
determination of the key parameters can be applied to other complex systems
with similar asymmetries.
