Is there any way to load programmatically entire history (of a Symbol and a Period) from server?

To add comments, please log in or register
Petr Nosek
3011
Petr Nosek  

I'm looking for programmatically solution of loading entire history for a symbol and a timeframe from server. I can do it manually by opening a chart with the required symbol and the required timeframe and then (unlock Scroll the chart button) by pressing Home and multiple pressing PgUp until I get to the oldest bar in the server history. But I need doing this by code (in the best way without opening the chart). Of course I can do it by programmatically opening the chart and simulating the keystrokes by API and then close the chart in the end. I was wondering if there is any easier solution? It may not be easier, but without opening and closing the chart and without API. Any Idea?

William Roeder
20207
William Roeder  
  1. If you don't have any history, here's how you can get all available from your broker.
  2. Programmaticly, you can get the last 2K bars via by handling 4066/4073 errors.
              Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum
Petr Nosek
3011
Petr Nosek  

whroeder1:

Programmaticly, you can get the last 2K bars.

The last 2K bars aren't my problem. I can get that very simple.

I need to get 32K (12K or 65K, entire broker's server history ) bars of history per timeframe. I can get that manually (or programmatically by simulating keystrokes) but I'm looking for another programmatically solution.

Ashish Kulkarni
987
Ashish Kulkarni  
Petr Nosek:

The last 2K bars aren't my problem. I can get that very simple.

I need to get 32K (12K or 65K, entire broker's server history ) bars of history per timeframe. I can get that manually (or programmatically by simulating keystrokes) but I'm looking for another programmatically solution.

Tickstory from www.tickstory.com already does that

Petr Nosek
3011
Petr Nosek  
Ashish Kulkarni:

Tickstory from www.tickstory.com already does that

Thank you for your effort but I don't need data from another broker (in this case from Dukascopy) for back testing but I need to load all available data from "my" broker's server into my terminal by MQL4 code.
Alain Verleyen
38646
Alain Verleyen  
Petr Nosek:

I'm looking for programmatically solution of loading entire history for a symbol and a timeframe from server. I can do it manually by opening a chart with the required symbol and the required timeframe and then (unlock Scroll the chart button) by pressing Home and multiple pressing PgUp until I get to the oldest bar in the server history. But I need doing this by code (in the best way without opening the chart). Of course I can do it by programmatically opening the chart and simulating the keystrokes by API and then close the chart in the end. I was wondering if there is any easier solution? It may not be easier, but without opening and closing the chart and without API. Any Idea?

You need to open the chart in all cases. If by API you mean WinAPI you don't need that, it can be done without it, using ChartNavigate().

Petr Nosek
3011
Petr Nosek  
Alain Verleyen:

You need to open the chart in all cases. If by API you mean WinAPI you don't need that, it can be done without it, using ChartNavigate().

Thank you Alain,

as usual, is your contribution to the matter. I'll try that and write the result here.

Petr Nosek
3011
Petr Nosek  
I can confirm that using ChartNavigate() works like a charm. I can get all availaible history from server within 2s. Pity that there is no solution without opening and closing the chart. At least I don't have to use the WinAPI because some VPS don't allow using DLLs.
To add comments, please log in or register