i got an indicator which the only way to retrieve buy and sell signals from is to analyse log Alerts produced by the indicator. i've tried every other way. But i *need* to automate it.
my question regards the correct way to open the log file and to analyse it.
1) is it possible to open the log file directly or do i have to do a copy first ?
2) what is the best way to open the log file ? Simply FileOpen() ?
3) how to periodically deal with new Alerts ? (reopening the file or letting it opened and reading the last line ?)
thanks a lot for your help
You skipped the very first step: how to force Metatrader to flush the log content to a disc from program code.
Log files are stored with separated directory (called Log not Files). MT4 standard functions can read from Experts/Files directory, thus even if you want to, you wont be able to read it in that way.
You could use windows API to access log directory of your platform, but as Omnia said - there is no way to "flush logs" in MT4.
The best way to flush alerts from indicator into a file is to simply code this inside the indicator. I spouse you don't have access to source code, but that's not a big deal, usually indicators
draws someting in buffers which you can read & analyze, or draws something on chart (like arrow or message) which you can also read and analyze in real time.
yeah i tried to do that but i can't retrieve any data except EMPTY_VALUE. no luck with objects either
maybe you'll have better luck than me so i attach the indi here if you could try ? that would be awesome
thanks a lot