Real Time data capture from Metatrader4 to an ASCII file.
+----------------------------------------------------------------------------------------------------+
+----------------------------------------------------------------------------------------------------+
RT_Data v1
This indicator is really old, and I don’t use it anymore. It captures
in real time, tick by tick, data from Metatrader to an ascii file.
The idea behind this indicator is to save data from mt4 and being able
to use it in other technical analysis software that allows importing
ascii EOD data, for example, DT6 or Advanced Get.
Depending in which timeframe the indicator is attached, it captures the
data for that specific timeframe, thus if you, for example, want to
capture H1, H4 and D1, you must have all those charts open in your mt4
platform and the indicator attached to each.
With every tick the ascii file is updated. No parameters associated to this indicator.
I don’t use it anymore because I replaced it with the RT_Data v2. Also I
had some glitches within DT6. Through this indicator, I was using mt4
as a realtime data server to feed quotes to DT6. In DT6 you can specify
how frequent you read data from a file, but if my indicator was writing
the file at the exact time DT6 was reading it, some chart issues
usually happen.
The files will be saved in the following path:
C:\program files\metatrader\experts\files\
+----------------------------------------------------------------------------------------------------+
RT_Data v2
This indicator replaced the RT_Data v1. It allows writing data for many timeframes at once with just one chart open. You can have many different instruments open (different symbols), no matter the timeframe, and capture different timeframe data files. Obviously you have to attach the indicator to the symbol to capture and select the timeframes you want to save from the parameter’s tab.
The format of the ascii file is the same as the v1.
A fundamental difference between v1 and this one is v2 is not entirely
realtime. In the parameter’s tab you can specify how frequent you want
to capture the data. The default value is 3 seconds, but you can define
any amount of time (in seconds). With this modification, is less
probable to have the chart issue with DT6 for example, as explained in
the v1 description.
Parameters
Frequency_update: every how many seconds do you want to update the file
File_extension: default *.prn
Number_bars: how many bars are going to be saved
From_year: if applicable, the starting year of gathering data
Completed_bar: only saves completed bars
period_weekly: Timeframe to capture
period_daily: Timeframe to capture
period_4hour: Timeframe to capture
period_1hour: Timeframe to capture
period_30min: Timeframe to capture
period_15min: Timeframe to capture
period_5min: Timeframe to capture
period_1min: Timeframe to capture
+----------------------------------------------------------------------------------------------------+
RT_Data v3
This indicator is almost the same as RT_Data v2. The main difference
is that it was designed to write data exclusively for NinjaTrader.
Accordingly, the ascii format changes a little bit to match NinjaTrader
requirements and it only saves 1 minute bar files because NinjaTrader
generates every timeframe based on 1 minute data.
No tick data available.
Like the v2, v3 allows writing data for many symbols at a time, no
matter the timeframe in mt4, the file will be 1 minute data formatted
for NinjaTrader.
Depending of the quality of the data feed in mt4, usually you will have
nice looking charts in NinjaTrader. What I haven’t been able to figure
out is to read this data in real time in NinjaTrader. This is a project
that I’m working on, although I’ve forgotten it for a while. To import
data from mt4 to NinjaTrader, you have to open the “historical data
manager” from the “tools” menu, then go to the “import” tab and hit
“start import” button to look for the file generated in mt4.
If you don’t see any change in your chart, switch to another instrument and go back to the previous one to update the chart.
+----------------------------------------------------------------------------------------------------+