  We introduce a microscopic model of interacting financial agents, where each
agent is characterized by two portfolios; money invested in bonds and money
invested in stocks. Furthermore, each agent is faced with an optimization
problem in order to determine the optimal asset allocation. The stock price
evolution is driven by the aggregated investment decision of all agents. In
fact, we are faced with a differential game since all agents aim to invest
optimal. Mathematically such a problem is ill posed and we introduce the
concept of Nash equilibrium solutions to ensure the existence of a solution.
Especially, we denote an agent who solves this Nash equilibrium exactly a
rational agent. As next step we use model predictive control to approximate the
control problem. This enables us to derive a precise mathematical
characterization of the degree of rationality of a financial agent. This is a
novel concept in portfolio optimization and can be regarded as a general
approach. In a second step we consider the case of a fully myopic agent, where
we can solve the optimal investment decision of investors analytically. We
select the running cost to be the expected missed revenue of an agent and we
assume quadratic transaction costs. More precisely the expected revenues are
determined by a combination of a fundamentalist or chartist strategy. Then we
derive the mean field limit of the microscopic model in order to obtain a
macroscopic portfolio model. The novelty in comparison to existent
macroeconomic models in literature is that our model is derived from
microeconomic dynamics. The resulting portfolio model is a three dimensional
ODE system which enables us to derive analytical results. Simulations reveal,
that our model is able to replicate the most prominent features of financial
markets, namely booms and crashes.
