Optimizing and how to log the Parameter-Setup???

 

Hi,

I am trying to optimize an EA - so I set various parameters to be changed. During the optimization his EA seems to be caught in an endless loop - no further progress :(

So I think I just write in init() some code to print the parameter setup of the actual variation:

                sPara1 = StringConcatenate("Para-Setting: ",ForSymbol,
                                           " delPdg: ",Del_Pending_After_Seconds," clsPos: ",Cls_Triggered_After_Seconds,"\n" );
                string fName = Symbol()+"_SetUp.txt";
                int Hdl = FileOpen(fName, FILE_BIN|FILE_WRITE);
                Print(fName," err: ",err(), " hdl: ",Hdl);
                //int Hdl = FileOpen(fName, FILE_BIN|FILE_READ|FILE_WRITE);FileSeek(Hdl, 0, SEEK_END);
                int wrt = FileWriteString(Hdl, sPara1, StringLen(sPara1));
                Print(fName," err: ",err()," wrt: ", wrt);
                FileClose(Hdl);
                Print(fName," (",err(),") => ",sPara1);

1) But instead of the varied parameters I always get once:

2013.11.25 11:50:33     xN GBPUSD,M1: GBPUSD_SetUp.txt (last Error Msg: no error) => Para-Setting:  delPdg: 240 clsPos: 240
2013.11.25 11:50:33     xN GBPUSD,M1: GBPUSD_SetUp.txt err: last Error Msg: no error wrt: 39
2013.11.25 11:50:33     xN GBPUSD,M1: GBPUSD_SetUp.txt err: last Error Msg: object is not exist hdl: 1

where delPdg: 240 clsPos: 240 is the default setting of the EA and NOT the variation:

extern int              Del_Pending_After_Seconds               = 240;
extern int              Cls_Triggered_After_Seconds             = 240;

This I get always once in the chart\expert-tab and only in the tester\journal-tab if I don't optimize.

2) I can't find the file GBPUSD_SetUp.txt which should have been successfully written? Neither in tester\files nor in \expert\files?

So what can I do to write the actual parameter set of an optimization-variation before is starts into a file either a log-file or my own file..

Any hint is appreciated!

Gooly

PS: I started now a brute force method: 413 952 variations for (only) 1 week test-time: 531 hours = 22 days :(

mt4 should offer different options than that!

 
gooly:

Hi,

I am trying to optimize an EA - so I set various parameters to be changed. During the optimization his EA seems to be caught in an endless loop - no further progress :(

So I think I just write in init() some code to print the parameter setup of the actual variation:

1) But instead of the varied parameters I always get once:

where delPdg: 240 clsPos: 240 is the default setting of the EA and NOT the variation:

This I get always once in the chart\expert-tab and only in the tester\journal-tab if I don't optimize.

2) I can't find the file GBPUSD_SetUp.txt which should have been successfully written? Neither in tester\files nor in \expert\files?

That sounds like a UAC issue . . . where do you have MT4 installed ?
Reason: