Get historical data

 

Hello,

Can someone tell me how can I export historical data from Meta Trader 4 to a file?

I just need a simple script/function that get a symbol-name, timeframe, start-date, end-date and outputs

the data to a new file in some readable format.

Thanks

 

You can save from a chart.

File -- save as

 
phy:

You can save from a chart.

File -- save as

Yes I know that, but it's limited to the time frame of the visual window.

Let say I need 1 minute data from 2004 till 2006, How can I do that?

 

I'm limited to around 2000 bars per symbol when using IBars, why is that?

Is it related to the account/server? Is there a way to increase this limit?

Thanks,
Gil

 

look at Tools > Options > Charts tab in client terminal, notice the Max bars in history and Max bars in chart settings.

click the Help button at bottom right of the Charts tab and you will get Userguide help page:
Client Terminal Settings — Charts

This will help clarify the HOWTO's of these two settings - have a play and see if helps...


Note that predefined variable Bars is same as int iBars() for the current chart symbol your program is running on.

 
ukt:

look at Tools > Options > Charts tab in client terminal, notice the Max bars in history and Max bars in chart settings.

click the Help button at bottom right of the Charts tab and you will get Userguide help page:
Client Terminal Settings — Charts

This will help clarify the HOWTO's of these two settings - have a play and see if helps...


Note that predefined variable Bars is same as int iBars() for the current chart symbol your program is running on.

Thanks,

But if I set Max Bars in History to a very big value I found that it reality it doesn't get more than around 2000.

Do you know why is this limitation ?

 

I can only relay to you what I do if want the chart to get as much historical data as it will download:

  1. disable Auto Scroll
  2. Zoom Out (-) as much as possible
  3. right click on chart: Refresh
  4. repeated pushing of Home key (notice how "Connection Status" on the Status Bar at bottom of screen will show increasing kb value as you push Home key)
  5. I keep doing until is obvious that no more data will be downloaded.

above is more than likely crazy way to do but have done for years and never felt need to research further.

hth

 
ukt:

I can only relay to you what I do if want the chart to get as much historical data as it will download:

  1. disable Auto Scroll
  2. Zoom Out (-) as much as possible
  3. right click on chart: Refresh
  4. repeated pushing of Home key (notice how "Connection Status" on the Status Bar at bottom of screen will show increasing kb value as you push Home key)
  5. I keep doing until is obvious that no more data will be downloaded.

above is more than likely crazy way to do but have done for years and never felt need to research further.

hth


That's more or less what I did, not really a robust way to get data... This is the basic for trading system development.
I wouldn't mind if it were able to get data for long periods but the maximum I got is 5 months for 1 minute data.
What's the oldest date you could get like that for this resolution ? I hope it's only a server limitation.
BTW, is there a way to get higher resolution data like ticks or 5/10 seconds ?

Thanks.

 

"maximum I got is 5 months for 1 minute data."

well, i guesstimate this is 144,000 M1 data chunks - is loads for my mind to take in ;)

how about this, on this site and actually on many forums, is topic of historical data, yes?

have snoop around and see what others did.

I know that Alpari has historical data which you can download (manually) and then via terminal functionality, import the data - just gotta get the dl'd data in correct format ;)

edit.1 (ahhh - just zoomed over there and all in nice little .zip containers - may just be what u after!)

http://www.alpari-idc.com/en/dc/databank.php

some historical data links I have kicking around - cannot vouch for integrity or if even still exist but worth a go...

http://www.dukascopy.com/english/ddf_main/rdata/ExportCSV/

"is there a way to get higher resolution data like ticks or 5/10 seconds ?"

unknown, but your forum searches will surely answer this and... not know if MT can store anyway. does it not have M1 as smallest periodocity? if so, then would assume data chunks stored at rate of one per M1 unit.

happy hunting

Reason: