Download MetaTrader 5

Getting pass number while EA is going through optimization in strategytester?

To add comments, please log in or register
Order the development and track its status via your mobile phone.
Young Ho Seo
15810
Young Ho Seo 2014.08.23 14:44 

Hello People

I am just curious if EA can commnuicate with strategytester duing its optimizaiton process.

I can see that with  "ParameterGetRange" and "ParameterSetRange" you can freely get and set optimizaiton parameters on strategy tester from your EA.

However I have not found the ways of getting  each pass number during optimization from EA. Does EA have an access to individual pass number and other statistics generated from strategyteser during runtime (not after optimziation is completed but during optimizaiton) ? 

Really appreciated if you could share your wisdom.

Kind regards.

 

 

Alain Verleyen
Moderator
30719
Alain Verleyen 2014.08.23 16:50  
Please see if this article can help you ?
MQL5 Cookbook: Saving Optimization Results of an Expert Advisor Based on Specified Criteria
MQL5 Cookbook: Saving Optimization Results of an Expert Advisor Based on Specified Criteria
  • 2013.10.15
  • Anatoli Kazharski
  • www.mql5.com
We continue the series of articles on MQL5 programming. This time we will see how to get results of each optimization pass right during the Expert Advisor parameter optimization. The implementation will be done so as to ensure that if the conditions specified in the external parameters are met, the corresponding pass values will be written to a file. In addition to test values, we will also save the parameters that brought about such results.
Young Ho Seo
15810
Young Ho Seo 2014.08.23 19:19  
angevoyageur:
Please see if this article can help you ?

Thanks for direction.

All I am trying to do is to simply get pass number.

Tried this code but nothing was printed.

int pass = 0;

void OnTesterPass()
{
    pass = pass + 1;
    printf("pass = %d", pass);
}

But it did not work.

Still don't get the concept of FrameAdd and FrameNext function. I think this might be much more complicated than we think as we have deal with multiple thread from the strategy tester. :)

Regards.

Alain Verleyen
Moderator
30719
Alain Verleyen 2014.08.23 20:02  
FinanceEngineer:

Thanks for direction.

All I am trying to do is to simply get pass number.

Tried this code but nothing was printed.

But it did not work.

Still don't get the concept of FrameAdd and FrameNext function. I think this might be much more complicated than we think as we have deal with multiple thread from the strategy tester. :)

Regards.

Why do you need the pass number ?
Young Ho Seo
15810
Young Ho Seo 2014.08.23 20:28  
angevoyageur:
Why do you need the pass number ?

Yes, I wanted to record pass number on the file, which created before optimization, as each pass in optimization is completed.

So I can write some other information on the file together.

Pass will tell me at which time and from what parameter setting the information was written. 

Kind regards.

Stanislav Korotky
17875
Stanislav Korotky 2014.08.23 22:54  
FinanceEngineer:

Yes, I wanted to record pass number on the file, which created before optimization, as each pass in optimization is completed.

So I can write some other information on the file together.

Pass will tell me at which time and from what parameter setting the information was written. 

Kind regards.

You should use  https://www.mql5.com/en/docs/optimization_frames/framenext function in OnTesterPass event handler - see the documentation on events:  https://www.mql5.com/en/docs/basis/function/events.
Documentation on MQL5: Working with Optimization Results / FrameNext
Documentation on MQL5: Working with Optimization Results / FrameNext
  • www.mql5.com
Working with Optimization Results / FrameNext - Reference on algorithmic/automated trading language for MetaTrader 5
Young Ho Seo
15810
Young Ho Seo 2014.08.24 01:25  
marketeer:
You should use  https://www.mql5.com/en/docs/optimization_frames/framenext function in OnTesterPass event handler - see the documentation on events:  https://www.mql5.com/en/docs/basis/function/events.

Thanks a lot. I will give a go. I never try this functon before and still try to get my head around with this concept of frame.

Got to have sometime to read. :)

Kind regards.

To add comments, please log in or register