optimization does no trades when back testing trades perfectly. - page 2

 
jtdjtd:

kanaps,

Did you ever solve this problem?  My original problem is, like yours, that Backtesting registers trades, Optimization registers ZERO trades.  In debugging, I've realized my EA oddly doesn't create an OBJECT during "Optimization" (which it successfully creates during Backtesting).  

Why do you find this odd ?  From here:  Testing Features and Limits in MetaTrader 4 

Special Features of Optimization Process

  • Nothing is output in the journal (either Print() function)

    This was done in order to accelerate the testing and save disk space. If complete logs are output the journal files will need hundreds of MByte.

  • Draw objects are not really set

    The objects are disabled in order to accelerate the testing.

 

RaptorUK,

Wow!  I apologize for not thinking of looking for something like "Special Features.." myself--my assumption of correspondence between Backtesting and Optimization was too strong.  Thank you once again for your assistance, jtd

 
gordon:
kanaps: Do you know any way of getting a message out while optimizing?
All file functions work normally in optimization. Just output your debug messages to a simple text file.
Alternatively use debugView and see the output in real time.
//{Log
// send information to OutputDebugString() to be viewed and logged by
// SysInternal's DebugView (free download from microsoft) This is ideal for
// debugging as an alternative to Print(). The function will take up to 10
// stringa (or numeric) arguments to be concatenated into one debug message.
//}
#import "kernel32.dll"
   void     OutputDebugStringA(string msg);
#import
void     Log(string s1, string s2="", string s3="", string s4="", string s5="",
         string s6="", string s7="", string s8="", string s9="", string s10=""){
   if(IsDllsAllowed()){
      string out  = WindowExpertName() + ": "
                           + s1 + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10;
      OutputDebugStringA(out);
}  }
 
jtd:

kanaps,

Did you ever solve this problem?  My original problem is, like yours, that Backtesting registers trades, Optimization registers ZERO trades.  In debugging, I've realized my EA oddly doesn't create an OBJECT during "Optimization" (which it successfully creates during Backtesting).  When I run "Optimization" and send the errors to a .txt file, according to the following code, I get error 4105 ("No order selected").  I'm confused--I believe I'm working with an OBJECT, not an ORDER.

I also fail to comprehend why this code successfully creates the OBJECT during Backtesting but fails during Optimization.

Any assistance would, as always, be greatly appreciated, jtd 

No, sorry. never resolved the issue.

I guess backtesting performed differently when optimizing. I guess. some functions are ignored. f.e. sleep is ignored when backtesting. 

 

The problem optimization yields zero profit or zero trades are TRENDLINES.

They are not drawn during optimization, IMHO.

Reason: