  A new multiagent model of the stock market is formulated that contains four
states in which the agents may be located. Next, the model is reformulated in
the language of the functional integral containing fluctuations of prices and
quantities of cash flows. It is shown that in the functional integral of that
type description of the prices is given not by the real numbers as is made in
many papers but the p-adic numbers. It is shown in the following simple
examples extracted from the proposed theory that the p-adic description of
prices gives good description of fractal behavior of the trends. The formula is
given for the p-adic mapping of prices. Using this formula we obtain the main
p-adic patterns which are the same as the patterns of Elliott wave theory, this
fact allows us to give a rigorous mathematical proof of this theory. Our model
is the only model that gives a strict point like description of the fractal
behavior of prices. The developed approach opens the possibility to give the
formulation of p-adic technical analysis of the stock market.
