saving historical quotes with mql4 (script)?

 

Is there a way to save historical quotes into ascii by some mql4 facilities, I am aware of the the history center in MT4 and the export button, but I'd like to have it scripted?

thx

 

Use the file functions to create whatever file you want

https://docs.mql4.com/files

 
are you looking for this? check out the attach file
Files:
 
phy:

Use the file functions to create whatever file you want

https://docs.mql4.com/files

hymns:
are you looking for this? check out the attach file

thank u guys both for the useful feedback. I also found this code in the section 2 of this article https://www.mql5.com/en/articles/1489


I still have a question, is there a way to request history data from MT server?


Because the solutions u offered or the one I found cannot do that, i.e. the data must be already available locally which is done either by having the respective chart open or requesting the data in the history data section.