Using different econometric models, Diebold and Li (J Econom 130:337-364, 2006) addressed the practical problem of forecasting the yield curve by predicting the factors level, slope and curvature in the Nelson-Siegel framework. This paper has two main aims: on the one hand, to investigate the predictive possibilities of the yield curve for the Spanish public debt market, using the methodology proposed by Diebold and Li (J Econom 130:337-364, 2006); and on the other hand, to study the capability of generating profits by transforming these yield curve predictions into technical trading strategies. The Sharpe ratios of our strategies outperform the hedging strategy benchmarks for long (1 year) horizons in our prediction period (2000)(2001)(2002)(2003)(2004)(2005)(2006)(2007)(2008)(2009)(2010) and also for the current crisis period (2008)(2009)(2010). Nevertheless, these strategies do not outperform their benchmarks for short (1 month) horizons. The introduction of nonparametric models improves the profitability of the strategies in terms of the Sharpe ratio, especially in the 1-year-ahead predictions. This finding is in line with Diebold and Li (J Econom 130:337-364, 2006), whose forecasts for long horizons are much more accurate than those of several standard benchmark models.