Code is provided for doing DMA as in the paper:
Koop, G. and Korobilis, D. (2012). “Forecasting Inflation Using Dynamic Model Averaging”, International Economic Review, 53, pp. 867-886.
In particular, below you can find code I wrote for the ECB in 2010 that demonstrates how to do direct forecasting with the DMA algorithm. This code is very thorough, easy to use, but still needs adaption if you want to use it on your own data.
Download code here: DMA_ECB.zip