Capital flows is an important aspect of the international monetary system because they pro-
vide great direct and indirect benefits, and at the same time, they carry risks of vulnerability
for countries with an open economy. Numerous works have studied the behavior of these
flows and have developed models to predict sudden stop events. However, the existing
models have limitations and the literature demands more research on the subject given that
the accuracy of the models is still poor, and they have only been developed for emerging
countries. This paper presents a new prediction model of sudden stop events of capital
flows for both emerging countries and developed countries with the ability to estimate accu-
rately future sudden stop scenarios globally. A sample of 103 countries was used, including
73 emerging countries and 30 developed countries, which has allowed the use of sample
combinations that consider the regional heterogeneity of the warning indicators. To the sam-
ple under study, a method of decision trees has been applied, which has provided excellent
prediction results given its ability to learn characteristics and create long-term dependencies
from sequential data and time series. Our model has a great potential impact on the ade-
quacy of macroeconomic policy against the risks derived from sudden stops of capital flows,
providing tools that help to achieve financial stability at the global level.