Exporting Chart Data

 

Hello everyone,

I've been working with MetaTrader for some time and I'm studying nonlagdot indicator (the code is attached.) After looking at many charts, I wanted to analyze the data as seen in the chart window in Excel. I wasn't able to find any way to export data as seen in chart window to a csv file, so I wrote a small exporter EA (code attached) which actually exports the bar data into a text file.

A simple exporter which exports data on every pass through start() function will export all tick data. I was interested only in the bar data for a specified time frame. I devised the following way of exporting bar data: drop in volume indicates beginning of new bar. So on every pass through start() function, the algorithm compares the volume with previously recorded. If the volume dropped, it means new bar started.

I ran my exporter for two days (05/31/2010 and 06/01/2010) on EURUSD, M30. I then compared exported data with what is seen on the chart. I saw that exported data is shifted back in time by one bar. In the MetaTrader chart view, you see that volume 311 was recorded for bar 06/01/2010 00:00 but in the exported data the bar with this volume is for 06/01/2010 00:30. Also, according to the chart, the bar with volume 101 is for 05/31/2010 23:30 but in exported data it is for 06/01/2010 00:00. This apparent shift applies to all the exported bars.

Perhaps this time shift is an artifact of my exporter EA design. I would highly appreciate it if you could go over it and let me know if you find an error. Otherwise, I'm curious at the implications that it has for EA design.

Thanks,

Norsulfazol

Files:
 

you make it too complicated

if you want simple

time -- open - close , candle high, candle low

you can just open the EURxxx30M . HST file in the EXCEL -- it is able to read it straight away i.e. no programming is required

[[ only each candle data, no indicator data window values]]

 

...

xxxx...you haven't even seen what the guy has to offer...why such an aggression so early in the morning?

 

Chart Data Exporting

xx3xxx:
you make it too complicated

if you want simple

time -- open - close , candle high, candle low

you can just open the EURxxx30M . HST file in the EXCEL -- it is able to read it straight away i.e. no programming is required

[[ only each candle data, no indicator data window values]]

xx3xxx,

Thanks for such a quick response. Unfortunately I wasn't able to find EURxxx30M.hst file in the MetaTrader directory or subdirectories. There is a file called EURUSD30.hst though. I wasn't able to open this file in Excel because it is a binary, not ascii. However, I would highly appreciate it if you could guide me through the process.

Also, it is essential to be able to export the indicator values with the candle data together to perform meaningful analysis because observations rest on visual (chart) data and they serve as foundation of my strategy.

Even if we circumvent the issue of opening candle data, it still doesn't explain the observed behavior of the system.

I welcome all your thoughts,

Thanks,

Norsulfazol

 

this is the step by step guide

-- please promise to share the result of your analysis , as I like OLAP too

1. open the chart in MT4 and choose the TIME FRAME that you want -- while it is the FOREGROUND window (it should be - now)

2. in MT4, [file] --> [ save as ]

pick the folder that you want, and save it -- suppose CSV is default to be open by EXCEL

then just go to that folder and double click it

data would be like

2010.05.26 18:05 77.88 77.96 77.87 77.95 101

2010.05.26 18:10 77.94 77.95 77.83 77.84 97

2010.05.26 18:15 77.84 77.86 77.8 77.85 118

2010.05.26 18:20 77.86 77.87 77.7 77.76 160

2010.05.26 18:25 77.77 77.79 77.68 77.71 228

neat and ready to be analyzed

and I forgot how to IMPORT data -- there seem to be a way to adjust the data and then be seen in MT4 -- but I have forgot i.e. reverse the process and use our template and indicator to see it

indicator value -- can't help you , mate

[even MT4 will recalculate -- rather than cache those indicator value; every single time, that you open MT4 ]

as I think You have to open the data window in live chart, and then MOUSE-OVER every candle, then punch in the data candle by candle, i.e. you can't do too many == if you are bored with trading, guess, you can copy it one by one -- for every candle

Reason: