Gordon,

Your code works fine on my computer with the following changes:

change cmae to spso (cmae is experiencing some problems that are well 
documented in this forum).  You can also add this to simplify the testing:
OptimizerSetOption("MaxEval",1 );




OptimizerSetEngine("spso"); 

OptimizerSetOption("MaxEval",1 );

B = Optimize("B",21,8,34,1); 

S = Optimize("S",13,5,20,1); 

Buy =Cover= Cross(C,EMA(C,B) ); 

Sell = Short=Cross(EMA(C,S),C ); 

MaxPos = 12; 

SetOption("MaxOpenPositions", MaxPos); 

PositionSize = -100/MaxPos; 





  ----- Original Message ----- 
  From: Gordon Sutherland 
  To: Amibroker 
  Sent: Monday, June 07, 2010 4:40 PM
  Subject: [amibroker] Re: Problem getting "CMAE" Optimizer to run


    

  Hi,

  I am having a problem getting the in-built non-exhaustive Optimizer "cmae" to 
run (or "spso" and "trib" for that matter). I can get the standard exhaustive 
Optimizer to run no problems. When I hit Optimizer in AA the program runs the 
first line and stops there. Before I burden Marcin with this problem I wonder 
if somebody with a similar configuration could run this basic AFL code in the 
Portfolio Mode and let me know if it runs OK. I am using Weekly mode but Daily 
or Monthly don't run for me either. I have not used the non-exhaustive 
Optimizer for quite a few months but have never had problems with it in the 
past.

  My set-up is: Windows 7 (x64); AB Pro 5.30.1 (32 bit); 

  Here is a basic set-up that I am using to troubleshoot the problem:

  OptimizerSetEngine("cmae"); 

  B      = Optimize("B",21,8,34,1); 
  S      = Optimize("S",13,5,20,1); 

  Buy    = Cross(C,EMA(C,B) ); 
  Sell   = Cross(EMA(C,S),C ); 

  MaxPos   = 12; 
  SetOption("MaxOpenPositions", MaxPos); 
  PositionSize   = -100/MaxPos; 

  Thanks,

  Gordon Sutherland



  

Reply via email to