Download MetaTrader 5

MT4 EA Candles History

To add comments, please log in or register
fxbusinessacc
29
fxbusinessacc  

Hello,

 I have an EA that needs to get all M1 bars currentyl in the server for a symbol. How can I achieve that?

 

Thanks

Carl Schreiber
7289
Carl Schreiber  
1) Either use CopyRates() - it can be used in MQL5 as well.

2 ) Or you use iOpen(), iHigh(), iLow(), iClose() as off the oldest Bar (=Bars-1).

Read in the editors reference (F1) about the various functions and take advantage of the examples.
fxbusinessacc
29
fxbusinessacc  

I used copyRates as you suggested for M1 bars. I can see in the client terminal that the oldest candle is 07/12/2016.

When calling the CopyRates I get only 2112 candles which the oldest value is yesterdays.

whroeder1
15913
whroeder1  
fxbusinessacc: When calling the CopyRates I get only 2112 candles which the oldest value is yesterdays.
  1. When you open a chart (copy rates) and don't have any history, you get about 2K bars from your broker for that TF.
  2. Here's how you can get all available from the broker.
fxbusinessacc
29
fxbusinessacc  

Yes I know about downloading from History Center but I dont want that options since it is not automated.

I also know that they keep data for 45 days for M1s. My question can I get these using an EA? Or there is a limit 

honest_knave
Moderator
2326
honest_knave  

You can use ChartNavigate to automate the process.

It isn't the most elegant solution.

See here 

fxbusinessacc
29
fxbusinessacc  

Thanks.

 

Apart from the ChartNavigate there isn't any other way, is it? 

honest_knave
Moderator
2326
honest_knave  
fxbusinessacc:

Thanks.

 

Apart from the ChartNavigate there isn't any other way, is it? 

Not that I am aware of, at least in code without using DLLs.

Happy to proven wrong though  

whroeder1
15913
whroeder1  
fxbusinessacc: Yes I know about downloading from History Center but I dont want that options since it is not automated.
  1. "Downloading from History Center" gets bars from MetaQuotes, not your broker.
  2. My post was downloading from your broker.
  3. You can't spend the 15 seconds per timeframe to get initial history, but you'll spend days trying to automate it?
fxbusinessacc
29
fxbusinessacc  
whroeder1:
  1. "Downloading from History Center" gets bars from MetaQuotes, not your broker.
  2. My post was downloading from your broker.
  3. You can't spend the 15 seconds per timeframe to get initial history, but you'll spend days trying to automate it?
Dude it seems that you did not understand the question. Problem is that the EA cannot retrieve them. 
fxbusinessacc
29
fxbusinessacc  
honest_knave:

Not that I am aware of, at least in code without using DLLs.

Happy to proven wrong though  

using DLLs? Can you explain further please?
12
To add comments, please log in or register