Hockenheim has put in place a deal to secure the future of the German Grand Prix until 2018.