The file I have attached works for me. I essentially tell it to wait a certain number of ticks (default set to 5) after init/restart before running the full export. I don't know why it works since I tried a lot of other ways to no avail. I think there is either a bug associated with FileOpen/FileClose or there is something about how it works that is not specifically described/documented but I am no expert.
You can implement what I did and erase the debug variables I included if you wish. However, I'm a big fan of using DebugView with MQL4 so if you don't use it already, I encourage you to take a closer look.
Aim
You can implement what I did and erase the debug variables I included if you wish. However, I'm a big fan of using DebugView with MQL4 so if you don't use it already, I encourage you to take a closer look.
Aim
DislikedI'm sorry, but after the changes described above the indicator works at the start of MT4, but it no longer refreshes the exported file. The reason, I suppose, is the code in point 4) should initiate that refresh process at the completion of the tfr bar and here it does nothing - no call to the Export() function, as there is no Export() function after I removed the void block. After many experiments with this code I have noticed that just doing without the 'void' structure and leaving that code in start() makes it start at the software opening and...Ignored
Attached File(s)
FXDataExport v2.mq4
16 KB
|
758 downloads