- Help with a csv export
- Code to download data
- Automated History Export
no response to my query in such an active forum?
That's usually your indication that you've asked a question that is viewed as being easily answerable if you invested a little more of your time into searching the code database and forums using the search function...or that you've asked a question that doesn't intrigue anyone enough to dig into it.
You can use the "Export-RT-Historical-Data-for-Ramp" MT4 indicator. It creates real time streaming .csv files that you can open in excel or any other program. It is free at http://www.ramprt.com/mt4/Ramp-MT4-Connection-Instructions.htm.
You can use the "Export-RT-Historical-Data-for-Ramp" MT4 indicator.
Hi is there any way to automatically save data from MT4 into CSV format? I have to go to each chart and manually click on File>Save as then save the entire history for the instrument, Doing this manually everyday becomes a very time consuming process. Is there any indicator or script that will save MT4 data for all time frames that I specify automatically?
You have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
I HAVE ATTEMPTED TO AQCUIRE THIS SCRIPT PLEASE TRY AND ASSISST ME MODIFY TO SUIT MY STYLE. IT EXPORTS THE HISTORICAL DATA IN CSV FORMAT ALRIGHT TO FILEOPENDATA FOLDER ALRIGHT BUT HAS THE FOLLOWING DEFICIENCIES.
1. CAN ONLY UPDATE THE HISTORY OF A SINGLE PAIR AND A SINGLE TIMEFRAME AT A TIME. I WANT IT MODIFIED TO MODIFY MANY PAIRS ABOUT 32(AUDCAD,AUDCHF,AUDJPY,AUDNZD,AUDUSD,CHFJPY,CADCHF,CADJPY,EURUSD,EURJPY,EURNZD,EURAUD,EURCAD ETC. ALL 32PAIRS.
2. SAVE ONLY THE H4=240,D1=1440,W1=3200 AND MN1=10080 TIMFRAMES FOR EACH OF THE 32 PAIRS LIKE ABOVE.
3. THE EXPORTED CSV FILE DOES NOT ARRANGE THE DATES AND DATA FROM THE LATER TO THE EARLIER BUT ARE AT RANDOM SORT OF.THE LAST DATA IS NOT THE EARLIEST BUT A DIFFERENT ONE TOGETHER.
4. THE COLUMS SHOULD BE IN THIS ORDER, DATE,TIME,OPEN,HIGH,LOW,CLOSE,VOLUME AND NOT MIXED UP
5. MAXIMUM OF 500 ROWS OF DATA FOR EACH PAIR AND TIME FRAME INCLUDING THE EARLIEST DATA.
int start() { GetHistory("USDCAD240.HST"); } void GetHistory(string FileName) { int i, start_pos, i_time, time0, last_fpos, periodseconds; double d_open, d_low, d_high, d_close, d_volume, last_volume; int hwnd=0,cnt=0; //---- History header int version=400; string c_copyright; string c_symbol=Symbol(); int i_period=0; int i_digits=Digits; int i_unused[13]; string str; int ExtHandle=FileOpenHistory(FileName,FILE_BIN|FILE_READ); if(ExtHandle<1) { Print("Cannot create file ", FileName); return(false); } // Get filename only int iPos = StringFind(FileName,"."); string outFile = StringSubstr(FileName, 0, iPos) + ".CSV"; // Open output file int Handle = FileOpen(outFile, FILE_CSV | FILE_WRITE, ','); // read header version = FileReadInteger(ExtHandle, LONG_VALUE); c_copyright = FileReadString(ExtHandle, 64); c_symbol = FileReadString(ExtHandle, 12); i_period = FileReadInteger(ExtHandle, LONG_VALUE); i_digits = FileReadInteger(ExtHandle, LONG_VALUE); int ii = FileReadInteger(ExtHandle, LONG_VALUE); //timesign ii = FileReadInteger(ExtHandle, LONG_VALUE); //last_sync FileReadArray(ExtHandle, i_unused, 0, 13); // Read the next line history while (!FileIsEnding(ExtHandle)) { i_time = FileReadInteger(ExtHandle, LONG_VALUE); d_open = FileReadDouble(ExtHandle, DOUBLE_VALUE); d_low = FileReadDouble(ExtHandle, DOUBLE_VALUE); d_high = FileReadDouble(ExtHandle, DOUBLE_VALUE); d_close = FileReadDouble(ExtHandle, DOUBLE_VALUE); d_volume = FileReadDouble(ExtHandle, DOUBLE_VALUE); if (d_open > 0) // if not end of file { FileWrite(Handle, TimeToStr(i_time,TIME_DATE),TimeToStr(i_time,TIME_MINUTES), d_open,d_high, d_low,d_close, d_volume); } } FileClose(ExtHandle); FileClose(Handle); //---- return(0); } //+------------------------------------------------------------------+
PLEASE ASSISST ME WITH THE ABOVE MODIFICATIONS. I HAVE ALSO ATTECH THE ACTUAL SCRIPT. FOR ANYONE TO SEE.
Please do not post in all capital letters.
It is considered shouting and not polite

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use