script or function to automatically export historical data ?

 
Hi gurus
I am new to MT4 and I really like the exportable historical data. However, I can't seem to find
a way to do it in an automatic way via script or function. Can this actually be done or not ?

Thanks
SD
Reason: