Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1461
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
In MT4 in the tester how to trace a stop button press for an indicator. OnDeinit is not called although the test is finished. Or how to close open files when stop button is pressed in tester.
open files should be automatically closed anyway
if not, try to create files with SB, there are CFile, CFileTxt as OOP - objects will be destroyed during deinitialization and destructors will close the files
https://www.mql5.com/ru/docs/standardlibrary/fileoperations
HH: Why do you think OnDeinit() is not called? - try to open and write a file in it
open files should be automatically closed anyway
if not, try to create files with SB, there are CFile, CFileTxt as OOP - objects will be destroyed during deinitialization and destructors will close the files
https://www.mql5.com/ru/docs/standardlibrary/fileoperations
HH: Why do you think OnDeinit() is not called? - Try to open and write a file in it.
By experience. I was surprised myself. Although, it is logically correct, it is an indicator and it should not be unloaded like an Expert Advisor. I have to delete the indicator from the tester chart manually or close the window. And only then I see Alerts after closing files)))
The tests are simple, I do not want to use bibbles. Yes and I think there is something other than mouse events on the stop button in the indicator tester. Superficial search cuts did not give unfortunately.
Zy, the files, if not closed, no access to them, and if OnDeinit() suddenly does not work, they will be closed by closing the terminal only.
Experienced way, forgot to record the closure of files)))
Experienced. I was surprised myself. Although logically everything is correct, it is an indicator, and it should not unload like an Expert Advisor. I have to manually delete the indicator from the tester chart or close the window. And only then I see Alerts after closing files)))
The tests are simple, I do not want to use bibbles. Yes and I think there is something other than mouse events on the stop button in the indicator tester. Superficial search cuts did not give unfortunately.
Zy, the files, if not closed, no access to them, and if OnDeinit() suddenly does not work, they will be closed by closing the terminal only.
Experienced way, forgot to record file closing)))
You haven't described the whole process of testing the indicator before
as far as i understood you run the indicator in the tester of MT4 in visual mode, although you can add the indicator..... in the visualizer of MT4
i have never tested an indicator in MT4, i just check it in EA in the TS code
as an alternative, set the date in the indicator, when you end the test as a variable and after reaching this date, save the file and exit OnCalculate() - the code is a couple of lines, but it will definitely work
You haven't described the whole process of testing the indicator before
as far as i understood you run the indicator in MT4 tester in visual mode, but you can also fill it in MT4 in the visualizer with indicator.....
i have never tested an indicator in MT4, i just check it in EA in the TS code
as an alternative, set the date in the indicator, when you end the test as a variable and after reaching this date, save the file and exit OnCalculate() - the code is a couple of lines, but it will definitely work
Yes, the tester window doesn't care if the indicator is being tested or if the indicator is overlaid on the tester window.
Thanks for that not so obvious crutch)
boolIsTesting();
Yes, the tester window doesn't care if the indicator is being tested or if the indicator is overlaid on the tester window.
Thanks for that not so obvious crutch)
boolIsTesting();
No, it didn't.
I have an open question, how to trace the event 2021.04.29 08:55:41.177 2020.10.01 08:23:13 Tester: stop button pressed
did so)
search for articles from Metacquot :"Cloud"
read a long time ago, should remote agents download the history from your PC or if connected to the same broker - take real ticks from the broker
but i may be wrong, i have not used it.
one of the articles from Metacquot on this subject, maybe there is information therehttps://www.mql5.com/ru/articles/2612
Igor, thanks. Documentation, forum, articles - haven't found an answer yet.
In the log there is:
"REGRES_EURGBP: ticks synchronized already [57 bytes]".
I hope this is what I need.
No, it did not.
Anyway, the question is open, how to track in the indicator test the event 2021.04.29 08:55:41.177 2020.10.01 08:23:13 Tester: stop button pressed
did so)
you have to write something like this:
can't remember MT4 lets test last day (today) - need to pick up t_stopIgor, thank you. Documentation, forum, articles - haven't found the answer yet.
In the log there is:
"REGRES_EURGBP: ticks synchronized already [57 bytes]".
I hope this is what I need.
moderators are silent, there are few active users
create a topic with your question in the general discussion, I think you will solve your problem faster
you have to write something like this:
I don't remember MT4 lets me test last day (today) - I need to pick t_stopI understand this idea, it's useful, but it doesn't work for me in this case. I need to time the Tester: stop button pressed in the indicator