[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Nested Optimizing Loops



PureBytes Links

Trading Reference Links




Steve - thanks
 
I was just trying to optimize two variables in the z-score 
statement.  Your code seems to work fine so thanks again and have a 
profitable day.  (Monday looks like it might be a very good 
day).
 
lou
================================
 
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Steve Dugas 
  
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Sunday, October 05, 2003 10:45 
  AM
  Subject: Re: [amibroker] Nested 
  Optimizing Loops
  
  Hi Lou,
   
  Just guessing here, I have not really tried to 
  understand your system, but...I dont think you want to keep track of 2 
  different equities, x and y. I made some quick changes, see if this is what 
  you were trying to do...
   
  Steve
   
  <FONT face=Arial 
  size=2>***************************************
   
  PositionSize = 2000;
   
  //range.bestequity = 0;xbestrange = 
  0;ybestrange = 0;
   
  // optimization loopfor( xrange = 5; xrange 
  < 17; xrange = (xrange + 1) ){ // optimization 
  loop for( yrange = 4; yrange < 19; yrange = (yrange + 1) 
  ) {  // spot for z score 
  code  ZScore=(Close-MA(Close,xrange))/StDev(Close,yrange);// 13 
  11  zLive = MA(zscore,4);  zsig = MA(MA(zscore,4), 
  3);
   
    Buy = Cross(Zlive, 
  zsig);  Sell = IIf(zlive < (zsig ), 1, 0);
   
    Le = LastValue( Equity() 
  );  if( Le > bestequity 
  )  {   bestequity = 
  Le;   xbestrange = xrange;   ybestrange 
  = yrange;  } }}
   
  Filter = BarIndex() == BarCount - 
  1;AddColumn( xbestrange, "xBest range" );AddColumn( ybestrange, "yBest 
  range" );AddColumn( Buy, "buy" );AddColumn( Sell, "sell" 
  );PositionSize = 2000;
  <BLOCKQUOTE 
  > 






Yahoo! Groups Sponsor


  ADVERTISEMENT









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.