The forecast method introduced by Korsós et al. is generalized from the horizontal magnetic gradient (GM), defined between two opposite polarity spots, to all spots within an appropriately defined region close to the magnetic neutral line of an active region. This novel approach is not limited to searching for the largest GM of two single spots as in previous methods. Instead, the pre-flare conditions of the evolution of spot groups is captured by the introduction of the weighted horizontal magnetic gradient, or WGM. This new proxy enables the potential to forecast flares stronger than M5. The improved capability includes (i) the prediction of flare onset time and (ii) an assessment of whether a flare is followed by another event within about 18 hr. The prediction of onset time is found to be more accurate here. A linear relationship is established between the duration of converging motion and the time elapsed from the moment of closest position to that of the flare onset of opposite polarity spot groups. The other promising relationship is between the maximum of the WGM prior to flaring and the value of WGM at the moment of the initial flare onset in the case of multiple flaring. We found that when the WGM decreases by about 54%, then there is no second flare. If, however, when the WGM decreases less than 42%, then there likely will be a follow-up flare stronger than M5. This new capability may be useful for an automated flare prediction tool.