Jeder kennt den Spruch: „Ein Bild sagt mehr als tausend Worte.“ Man kann zig Bücher über Paris oder Venedig lesen, aber die geistigen Vorstellungen vermitteln einem nie dasselbe Gefühl wie ein Spaziergang durch die abendlichen Straßen. Der Vorteil der Veranschaulichung oder der grafischen Darstellung lässt sich auf jeden beliebigen...
doubleOnTester() {
double dd = sqrt(TesterStatistics(STAT_BALANCE_DDREL_PERCENT)),
oD = (TesterStatistics(STAT_BALANCE_DDREL_PERCENT)),
pr = TesterStatistics(STAT_PROFIT);
if (dd == 0.0) return(100.0*pr);
string name =""; // Public name/frame labelulong pass =0; // Number of the optimization pass at which the frame is addedlong id =0; // Public id of the framedouble val =0.0; // Single numerical value of the framedouble stat_values[];
FrameNext(pass,name,id,val,stat_values);
if ( true ) { // pass%1 == 0 ) {PrintFormat("%s pass %i otgDD%% %s sqrt(DD%%) &s Profit %s ret %s",
TimeToString(TimeLocal(),TIME_SECOND),pass,DoubleToString(oD,5),DoubleToString(dd,5),DoubleToString(pr,3),DoubleToString(pr/dd,5) );
}
return ( pr/dd );
}
and failed as Print() (and I guess PrintFormat()) isn't available in the StrategyTester.
I finally got it by appending line by line to a file in the Common folder:
doubleOnTester() {
double dd = sqrt(TesterStatistics(STAT_BALANCE_DDREL_PERCENT)),
oD = (TesterStatistics(STAT_BALANCE_DDREL_PERCENT)),
d1 = TesterStatistics(STAT_BALANCEDD_PERCENT),
d2 = TesterStatistics(STAT_BALANCE_DDREL_PERCENT),
d3 = TesterStatistics(STAT_EQUITYDD_PERCENT),
d4 = TesterStatistics(STAT_EQUITY_DDREL_PERCENT),
pr = TesterStatistics(STAT_PROFIT);
if (dd == 0.0) return(100.0*pr);
string name =""; // Public name/frame labelulong pass =0; // Number of the optimization pass at which the frame is addedlong id =0; // Public id of the framedouble val =0.0; // Single numerical value of the framedouble stat_values[];
FrameNext(pass,name,id,val,stat_values);
if ( true ) { // pass%1 == 0 ) {
addLineToFileCommon(StringFormat("pass: %i %s d1 %05.2f d2 %05.2f d3 %05.2f d4 %05.2f org DD%% %05.2f sqrt(DD%%) %05.2f Profit %07.2f ret %07.2f\n",
pass,TimeToString(TimeLocal(),TIME_SECONDS),(d1),(d2),(d3),(d4),(oD),(dd),(pr),(pr/dd)),
"StratTest.txt");
}
return ( pr/dd );
}
The percent values are provided from 0 to 100.
But pass is always 0 (?) and TimeLocal always 23:59:59:
This is the corresponding table of the optimization:
Interesting to see the table shows 15 lines my file only 14. The first entry is missing. But the counter shows 13:
The empty line of the table corresponds to this log-entry:
2018.12.2017:24:24.531 Core 05 genetic pass (0, 2) tested with error "incorrect input parameters" in 0:00:00.250
And this shows that - I guess - the 'non-passes' due to "return(INIT_PARAMETERS_INCORRECT)" or "return(INIT_FAILED)" still is counted by the Tester and the genetic Algorithm:
2018.12.20 17:24:47.636 Tester genetic optimization finished on pass 15 (of 1048576)
2018.12.20 17:24:47.636 Statistics optimization done in 0 minutes 26 seconds
2018.12.20 17:24:47.638 Statistics shortest pass 0:00:00.250, longest pass 0:00:23.120, average pass 0:00:10.869
2018.12.20 17:24:47.638 Statistics local 15 tasks (100%), remote 0 tasks (0%), cloud 0 tasks (0%)
2018.12.20 17:24:47.654 Tester 15 new records saved to cache file 'tester\cache\NewEAb v003.EURUSD.H1.20170108.20171223.11.32E03FFA9573C89D9A9C8BF2DFA77676.opt'
Sigh!
This was my try:
I am not sure about FrameNext as the function "moves the pointer" and this might mess up the optimization?
I am not sure about FrameNext as the function "moves the pointer" and this might mess up the optimization?
FrameNext is intented to get data from Frame which are sending by tester agents by FrameAdd. It is like iterator for traversing all frames
See also sample in https://www.mql5.com/de/articles/403
FrameNext is intented to get data from Frame which are sending by tester agents by FrameAdd. It is like iterator for traversing all frames
See also sample in https://www.mql5.com/de/articles/403
Ok - I tried this:
and failed as Print() (and I guess PrintFormat()) isn't available in the StrategyTester.
Sigh!
Check this option
Ok - I tried this:
and failed as Print() (and I guess PrintFormat()) isn't available in the StrategyTester.
Sure, it is written
Check this option
It is enabled, but despite that I thought that the tester agents (even the local ones as I don't use the cloud yet) don't accept dlls.
I thought that the tester agents (even the local ones as I don't use the cloud yet) don't accept dlls.
Do you use remote agents in your home network?
Do you use remote agents in your home network?
No, even not the MetaTester Agents of the cloud on my pc. Just the one that has come with the terminal.
I finally got it by appending line by line to a file in the Common folder:
The percent values are provided from 0 to 100.
But pass is always 0 (?) and TimeLocal always 23:59:59:
This is the corresponding table of the optimization:
Interesting to see the table shows 15 lines my file only 14. The first entry is missing. But the counter shows 13:
The empty line of the table corresponds to this log-entry:
And this shows that - I guess - the 'non-passes' due to "return(INIT_PARAMETERS_INCORRECT)" or "return(INIT_FAILED)" still is counted by the Tester and the genetic Algorithm: