Genetic programming (GP) is used to obtain multiperiod bankruptcy prediction models, as well as to perform a prior feature selection process for these models. Given the controversy in the field of bankruptcy prediction about the need to include (or not) variables from the economic environment as input information for the prediction models, an analysis is carried out to check whether the impact that the economic environment undoubtedly has on the firms can be captured using only the financial variables of the firm as explanatory variables. To this end, the analysis includes a study of the correlation between the estimates of the prediction models and certain economic indicators. The results confirm the possibility of capturing the evolution of the economic environment using only financial information as input, as strong correlations are shown between the predictions of the models and important economic indicators over a very long postlearning period (2008–2020) and varied in terms of the economic environment (crisis, recovery, COVID, etc.).