The prediction of solar flares is still a significant challenge in space weather research, with no techniques currently capable of producing reliable forecasts performing significantly above climatology. In this paper, we present a flare forecasting technique using data assimilation coupled with computationally inexpensive cellular automata called sandpile models. Our data assimilation algorithm uses the simulated annealing method to find an optimal initial condition that reproduces well an energy-release time series. We present and empirically analyze the predictive capabilities of three sandpile models, namely the Lu and Hamilton model (LH) and two deterministically-driven models (D). Despite their stochastic elements, we show that deterministically-driven models display temporal correlations between simulated events, a needed condition for data assimilation. We present our new data assimilation algorithm and demonstrate its success in assimilating synthetic observations produced by the avalanche models themselves. We then apply our method to GOES X-Ray time series for 11 active regions having generated multiple X-class flares in the course of their lifetime. We demonstrate that for such large flares, our data assimilation scheme substantially increases the success of ``All-Clear'' forecasts, as compared to model climatology.