'Simulation/Bootstrap Forecasting from Univariate GARCH Models 'Open the workfile wfopen ".\xbtusd.wf1" 'Get rid of missing values pagecontract if dlog(xbtusd)<>NA 'Visualize the price series freeze(chart1,mode=overwrite) xbtusd.line chart1.axis dual 'Visualize the log return series freeze(chart2,mode=overwrite) dlog(xbtusd).line chart2.axis dual 'Fit a simple univariate GARCH model for volatility equation garchmodel.arch(backcast=1) dlog(xbtusd)*100 c 'GARCH(1,1) model with normal errors 'Visualize estimated conditional volatility garchmodel.makegarch condvar freeze(chart3,mode=overwrite) condvar.line chart3.axis dual 'Forecast horizon !nhor=22 'Restructure the end date of workfile to cover the forecast horizon pagestruct(end=@last+!nhor) * !nrep = 10000 'number of simulations !per = 10 'percentile for confidence interval garchmodel.simulugarch(method=2,nsim=!nrep,horizon=!nhor,percentile=!per,chart=2)