The increasing attention to environmental issues is forcing the implementation of novel energy models based on renewable sources, fundamentally changing the configuration of energy management and introducing new criticalities that are only partly understood. In particular, renewable energies introduce fluctuations causing an increased request of conventional energy sources oriented to balance energy requests on short notices. In order to develop an effective usage of low-carbon sources, such fluctuations must be understood and tamed. In this paper we present a microscopic model for the description and the forecast of short time fluctuations related to renewable sources and to their effects on the electricity market. To account for the inter-dependencies among the energy market and the physical power dispatch network, we use a statistical mechanics approach to sample stochastic perturbations on the power system and an agent based approach for the prediction of the market players behavior. Our model is a data-driven; it builds on one day ahead real market transactions to train agents behaviour and allows to infer the market share of different energy sources. We benchmark our approach on the Italian market finding a good accordance with real data.