Log in to your MT5 terminal and click on the ‘History’ in the ‘Toolbox’ window at the bottom of your MT5 screen.
From the displayed interface, click "Report" and then select Open XML (MS Office Excel 2007) or HTML (Internet Explorer).
By pressing CTRL+U, you can also download the tick history for the timespan you want.