Change Date format on MT4 .csv files?
Page 1 of 615 123 ... LastLast
Results 1 to 10 of 41

Thread: Change Date format on MT4 .csv files?

  1. #1
    Is there anyway to set or modify the format of date in .csv files stored using MT4? As I'm attempting to import them into a different program and it does not work since it doesnt support the default option MT4 format. Any help appreciated.

  2. #2
    Thank You a lot for the script. It works flawlessly !!!

  3. #3
    Hi Creztor

    Sorry I don't know of any way to acquire MT4 to do this.

    Here's a possible workaround:

    1. Download FREEWARE text editor EmEditor from http://shareme.com/download/emeditor-free.html
    and then run the .MSI file to set up (into \Program Files\EmEditor)
    Then run EmEditor

    2. Open the document (press Ctrl-O) whose dates you wish to modify.

    3. Press Ctrl-H for search/replace, and assess Use Regular Expressions ON.
    Type precisely
    ^(...)\. (. .) \. (. .)
    To the Find field, and
    \two-\3-\1
    into the Replace with field
    [NOTE: this presumes you want to change to format MM-DD-YYYY; change the hyphens to whatever separator you need; also change 1,2,3 around however you wish: 1=YYYY, two=MM, 3=DD, e.g. to obtain DD/MM/YYYY, kind
    \3/\2/\1
    make certain the backslashes \ stay where they are]
    Click on Replace All, and then press Esc to close search/replace, and Ctrl-S to store the document.

    4. Repeat steps 2 to every document, as required. Note your entries in the Find and Replace with stay sticky: you only ever need to sort them once. EmEditor also recalls the folder from which you opened the last CSV file.

    You could rather load the files into Excel and manipulate using formulae, but - once the Find and Replace with entrances are set up in EmEditor - it's considerably faster. It's extremely fast and easy once you've done it a couple of times.

    Hope this helps.

    David

  4. #4
    If you understand what you're doing, it's pretty straightforward. Produce a script that iterates over data and creates your personal custom made .csv file. You'll make significant use of the document functions, http://docs.mql4.com/files.

  5. #5
    Quote Originally Posted by ;
    If you know what you're doing, it is pretty simple. Create a script that iterates more data and generates your personal custom made .csv file. You'll make significant use of the file functions, http://docs.mql4.com/files.
    When I knew what I was doing I would not find here

    Thank you I will give this a try.

  6. #6
    Hanover that is precisely what I want, thank you VERY much.

  7. #7
    Quote Originally Posted by ;
    If I knew what I was doing I wouldn't post here

    Thanks I shall give a try.
    Sorry man, in my haste I guess I assemble a reply that was too curt to be useful.

  8. #8
    Hi Creztor

    Tesla is absolutely right, it's very simple to write a script to do this, hence I've done so (see below).
    When I said ”I really don't know how to get MT4 to perform this” in my prior post, I was referring to the File Save purpose.

    The script below assumes you need the following format:
    mm --dd--yyyy,hh:mm,Open,High,Low,Close,Volume

    Otherwise, allow me to know and I will change accordingly.

    Just download the document below into your
    C:\Program Files\lt;meta trader foldergt;\experts\scripts
    folder.

    Subsequently run MT4 and press on Ctrl-N to open Navigator
    Open up the ”Scripts” tree, then drag ”output_history” onto the desired chart.
    Message ”History output complete” appears in top left corner of chart.

    Look in folder
    C:\Program Files\lt;meta trader foldergt;\experts\documents
    and you should see your history (e.g. ”AUDUSD,60. CSV” file is H1 for AUDUSD).

    Now you have an alternative method.

    David

    [Edit: experienced MQL4 developers, please do not laugh too hard at my kindergarten coding]
    https://www.nigeriaforextrading.com/...4322860964.mq4

  9. #9
    Hello,

    I downloaded the script that was attached, and this is close to what I want. Since I do not know the script language, I would really love some help.

    I want to automate the process of creating the CSV file, when I start metatrader, for a list of pairings. I already modified the script I want. Simply write one line for one pair and will copy and paste for the others. I also need the header at the initial line DATE, TIME, etc.. .
    Would it be possible to alter the current script to automate the process ?

    Also, is it feasible to revert the process. IMPORT csv files into the database. (chart stocks by way of instance)

    Your help would be well appreciated.

    Thanks.

  10. #10
    Serhito, I've responded to a email.

    In case anybody else needs the updated version of output_history. It's attached. It may now be easily altered to output any number of currency pair/timeframes information history in one run. Directions in the comments region of the script.

    David
    https://www.nigeriaforextrading.com/...1323623185.mq4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.