Download daily data

 
I want to be able to download daily bars for every available pair once per day. Is this possible to automate?
 
Open a daily chart, one for each available pair. Done.
 
Yes, but automate? I trade about 50 pairs.
 
Too less information about what you want. What exactly do you want to download, where and what template?
 
I have txt files of daily OHLC data for each of the pairs i trade. I would like to automatically append the files with new data at the end of every day.
 

Something like that

int daywrite;
int start()
{
if(daywrite==Day())return(0);
daywrite=Day();
string cur="EURUSD";
int hand=FileOpen("EURUSD.txt",FILE_READ|FILE_WRITE);
FileSeek(hand, 0, SEEK_END); 
FileWrite(hand,iOpen(cur,PERIOD_D1,1),iHigh(cur,PERIOD_D1,1),iLow(cur,PERIOD_D1,1),iClose(cur,PERIOD_D1,1));
FileClose(hand);
}


 
Yes, thanks, but is it possible to run automatically for all 50 pairs?
 
fxtraydor:
Yes, thanks, but is it possible to run automatically for all 50 pairs?

Yes. I am putting something together at the moment in the form of a script. I have a .txt file with a list of 70 instruments that I am interested in - the script reads these and loads them in to an array, which is then used in a loop to write to a .csv file. This will allow me to review all of the instruments on one Excel worksheet.

You might find Komposter's code useful to get you started - it helped me!

 
oneday:

Yes. I am putting something together at the moment in the form of a script. I have a .txt file with a list of 70 instruments that I am interested in - the script reads these and loads them in to an array, which is then used in a loop to write to a .csv file. This will allow me to review all of the instruments on one Excel worksheet.

You might find Komposter's code useful to get you started - it helped me!


But do you intend to automatically download the data from MT4?
 
fxtraydor:
Yes, thanks, but is it possible to run automatically for all 50 pairs?

Again, I don't know, you want it in one file or 50?
 
Roger:

Again, I don't know, you want it in one file or 50?

50, but that is inconsequential. I haven't figured out a way to get the OHLC data from MT4 by calling the symbol or somesuch. Something like MarketInfo() could work, but that function only returns current data, I need to be able to get the DOHLC for the most recent n bars.
Reason: