Forecasting volatility using high-frequency data