Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Record live data to save as external text file (EA MT4)
I know that such tool exists at least for NinjaTrader as a strategy which acts as a recorder of live market tick data that saves it in real-time in text files. Of course, formatting outputs can be configured as parameters, as well with the right input separators (maybe even format templates to remember)
I am obliged to work with MT4 for a project and I am wondering if such EA or similar already is available for MT4 ?
(to me the M1 data export function within MT4 is not enough, does not do the trick)
Thanks for your help
Can you help answer these questions from other members on NexusFi?
}
//--- close the file
FileClose(file_handle);
PrintFormat("Data is written, %s file is closed",fileName);
}
void OnDeinit(const int reason)
{
DumpPrices();
Yes, for a programmer this is not difficult. However, recording to (and later reading from) a text file is a quite unprofessional approach (looking at you, MultiCharts). The data amount aggregated quickly becomes to large for text files. So the format has to be binary and MT4 supports read/write access to the binary data format of its database. Not so MT5, Multicharts or NinjaTrader.
As an actual example of how-to-do have a look at the following codes:
This is one example and shows the general approach. A complete recorder records all timeframes at once and saves them as real instruments, not as offline charts. But the data format and reading/writing it is exactly the same as in the above example.
Best
edit: You are not restricted to standard timeframes but can read/write whatever you wish, e.g. 5-seconds charts or 2-minutes charts.