The operation of energy storage systems (ESSs) in power systems where variable renewable energy sources (VRESs) and ESSs must contribute to securing the supply, can be considered as an arbitrage against scarcity. The value of using stored energy instantly must be balanced against its potential future value and future risk of scarcity. This paper proposes a multi-stage stochastic programming model for the operation of microgrids with VRESs, ESSs and thermal generators that is divided into a short- and a long-term model. The short-term model utilizes information from forecasts updated every six hours, while the long-term model considers the value of stored energy beyond the forecast horizon. The model is solved using stochastic dual dynamic programming and Markov chains, and the results show that the significance of accounting for short- and long-term uncertainty increases for systems with a high degree of variable renewable generation and ESSs and limited dispatchable generation capacity.