Auto saving/export of MT4 Data

Back to topics list To post a new topic, please log in or register
avatar
8
deuce 2010.07.27 14:47
 
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?
 
avatar
8
deuce 2010.07.31 09:38 #
 
no response to my query in such an active forum?
avatar
705
1005phillip 2010.07.31 16:28 #
 
deuce:
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.
 
avatar
8
deuce 2010.08.02 18:22 #
 
I did some searching however I was not able to find any tool that would perform the required function so that is why I posted for assistance. Can you tell me if there is any tool that performs the requested functions?
 
avatar
9
thewebdncr 2010.09.16 22:37 #
 

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.

 
avatar
893
7bit 2010.09.16 23:15 #
 
thewebdncr:

You can use the "Export-RT-Historical-Data-for-Ramp" MT4 indicator.

How many hundred more old and long forgotten threads are you going to bump to the front page with the exact same message?
 
avatar
2
koya_24 2010.09.17 00:02 #
 
hi mt4 plz am new in forex trade plz l need train on how to use expert advisor plz l mean full how to conplied dat that can test my trade l do not know how to do this .4rm koya.
 
avatar
3
willkirsten5 2016.03.11 23:32 #
 
deuce:
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?
PLEASE  NEED A SIMILAR SCRIPT OR EA ANY HELP OR SOLUTION?
avatar
12985
WHRoeder 2016.03.12 02:04 #
 
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.
avatar
3
willkirsten5 2016.03.12 09:34 #
 
WHRoeder:
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.



Attached files:
  historicaldata.mq4  (2.90 KB)
avatar
Moderator
3407
GumRai 2016.03.12 09:50 #
 

Please do not post in all capital letters.

It is considered shouting and not polite

Back to topics list  

To add comments, please log in or register