How to Obtain Historical Data in Form of Candlestick Image?

 

I am aware that MT4 automatically keeps data in charts from past minutes, hours, days,etc

Also, I am aware that there are some indicator scripts that allow data collection from future information.

I want to create a script that would return past information in the form of candlesticks charts. In other words, I just need a way to extract a candlestick chart from MT4 into a figure given determined amount of time.

Thank you very much, I appreciate any help or leads in the right direction.

 
knowNothing:

I am aware that MT4 automatically keeps data in charts from past minutes, hours, days,etc

Also, I am aware that there are some indicator scripts that allow data collection from future information.

I want to create a script that would return past information in the form of candlesticks charts. In other words, I just need a way to extract a candlestick chart from MT4 into a figure given determined amount of time.

Thank you very much, I appreciate any help or leads in the right direction.

Open the History Center (F2) and export the data that you want.
 
RaptorUK:
Open the History Center (F2) and export the data that you want.


Thank you for your prompt response, but I am looking to do this from code.

I am aware that

FileOpenHistory( string filename, int mode, int delimiter=';')

is used for something similar, if not the same.

How can I specify the time boundaries? I am looking at documentation, but so far I see no result.

I want past documentation. I have seen a few programs that obtain documentation from the time that they are triggered. They call them Custom Indicators, I think.

 
knowNothing:


Thank you for your prompt response, but I am looking to do this from code.

I am aware that

FileOpenHistory( string filename, int mode, int delimiter=';')

is used for something similar, if not the same.

How can I specify the time boundaries? I am looking at documentation, but so far I see no result.

I want past documentation. I have seen a few programs that obtain documentation from the time that they are triggered. They call them Custom Indicators, I think.

You can get the OHLC data for any bar, assuming you have the data already, using Open[], High[], Low[] and Close[] and then you can write this to a CSV file using the file functions . . . alternatively you can get different timeframe data using iOpen(), iHigh(), etc.
 

RaptorUK:

You can get the OHLC data for any bar, assuming you have the data already,...

In other words, I can't say call a script that would create an offline chart of candles from the day before ?

Most scripts I have seen create the chart, but starting at the moment they trigger the script. The drawbacks is that if a person wants the previous day candlestick chart, they are unable to get it. They could get future data, but not old.

 
knowNothing:

In other words, I can't say call a script that would create an offline chart of candles from the day before ?

Most scripts I have seen create the chart, but starting at the moment they trigger the script. The drawbacks is that if a person wants the previous day candlestick chart, they are unable to get it. They could get future data, but not old.


If you can code it then yes you can call it . . . if you want tick data then no you can't anything other than live data, tick data is not stored, M1 and above is stored.
 
try this.
Files:
 
szgy74:
try this.

I have dissected the code, but I am still unaware of how to obtain past candlestick data.

I studied CustomCandle.mq4

I know that the rest of the programs are modifications of this one. Were you talking about CustomCandle6.mq4 ? The field TimeShift = -1 seems to do something to the data.

Also, just to be clear, I will state my goal again. I want to create an offline chart using a custom made time frame. I have been able to analyze incoming data and modify it at will, but I am looking to do the same to past information.

Any help will be appreciated.

 
knowNothing:

I have dissected the code, but I am still unaware of how to obtain past candlestick data.

I studied CustomCandle.mq4

I know that the rest programs are modifications of this one. Were you talking about CustomCandle6.mq4 ? The field TimeShift = -1 seems to do something to the data.

Also, just to be clear, I will re-state what I want. I want to create an offline chart using a custom made time frame. I have been unable to analyze incoming data and modify it at will, but I am looking to do the same with past information.

Any help will be appreciated.

You should look at the live period converter stuff at ForexFactory
 
RaptorUK:
You should look at the live period converter stuff at ForexFactory


Will do, thanks.

I am still waiting for your response, szgy.