Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Ok thanks, I wasn't really sure which was better..
I removed my previous post because I misunderstood your question.
I have a question however, is it not the case that the OnTesterPass is only called when you use the FrameAdd functionality?
Also, the line "#property strict" is only used in MQL4. It's totally ignored in MQL5. Use it only if your code is meant to compile on both.
From the documentation ...
The TesterPass event is generated automatically when receiving a frame during an Expert Advisor optimization in the strategy tester.
An EA having OnTesterDeInit() or OnTesterPass() event handler is automatically downloaded on a separate terminal chart during the optimization start. It has the symbol and the period that have been specified in the tester. The function is meant for handling frames received from test agents during optimization. The frame containing test results should be sent from the OnTester() handler using the FrameAdd() function.
Keep in mind that optimization frames sent by test agents using the FrameAdd() function may come in bundles and take time to deliver. Therefore, not all frames, as well as TesterPass events, may arrive and be processed in OnTesterPass() before the end of optimization. If you want to receive all belated frames in OnTesterDeinit(), place the code block using the FrameNext() function.
After completing OnTesterDeinit() optimization, it is possible to sort all received frames again using the FrameFirst()/FrameFilter and FrameNext() functions.
- www.mql5.com
From the documentation ...
The TesterPass event is generated automatically when receiving a frame during an Expert Advisor optimization in the strategy tester.
An EA having OnTesterDeInit() or OnTesterPass() event handler is automatically downloaded on a separate terminal chart during the optimization start. It has the symbol and the period that have been specified in the tester. The function is meant for handling frames received from test agents during optimization. The frame containing test results should be sent from the OnTester() handler using the FrameAdd() function.
Keep in mind that optimization frames sent by test agents using the FrameAdd() function may come in bundles and take time to deliver. Therefore, not all frames, as well as TesterPass events, may arrive and be processed in OnTesterPass() before the end of optimization. If you want to receive all belated frames in OnTesterDeinit(), place the code block using the FrameNext() function.
After completing OnTesterDeinit() optimization, it is possible to sort all received frames again using the FrameFirst()/FrameFilter and FrameNext() functions
Fernando for the win! that worked, I can't believe I missed that. thank you sir.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
After exhaustive testing and even some chatgpt help it would seem that there is a bug with the OnTesterPass(), I'm hoping someone can shed some light or we can get this issue fixed (I'm far far from a great programmer).
I'm trying to do an optimization and store some data but it would seem that the function is not firing after each pass, im using the slow complete optimization with 1000 parameters, i've used all of my local agents and also just one single one with the same result.
I've tried minimal test ea's with some print statements and I can't get it to fire, i've also tried downloading a fresh mt5 off of the official website and to no avail sadly... here's what I have so far:
I've attached some pictures so you can see some logs and settings.
I could really use some help! lol