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

Re: [amibroker] ParamOptimize - syntax help



PureBytes Links

Trading Reference Links

James,

Put the code I given ON THE TOP of your formula:

function ParamOptimize( name, default, minv, maxv, step )
{
 return Optimize( name,  Param( name, default, minv, maxv, step ), minv, maxv, step );
}

Then just call it as you would do with built-in functions:


EntryBars = ParamOptimize("Entry Bars", 15, 1, 100, 1);

Full code:

/////////////// START/////////////////

function ParamOptimize( name, default, minv, maxv, step )
{
 return Optimize( name,  Param( name, default, minv, maxv, step ), minv, maxv, step );
}

EntryBars = ParamOptimize("Entry Bars", 15, 1, 100, 1);
Buy = ... your rules here...
Sell = ....your rules here

///////////// END /////////////////////

Best regards,
Tomasz Janeczko
amibroker.com
  ----- Original Message ----- 
  From: James 
  To: amibroker@xxxxxxxxxxxxxxx 
  Sent: Thursday, February 01, 2007 8:20 PM
  Subject: [amibroker] ParamOptimize - syntax help


  Could someone help me with the syntax for ParamOptimize? It is not really in the function guide, just a comment by TJ under optimize. Here is the stated syntax:

  function ParamOptimize( name, default, minv, maxv, step )
  {
  return Optimize( name, 
  Param( name, default, minv, maxv, step ),
  minv, maxv, step );
  }

  Here are the 2 statements I am trying to combine:

  //EntryBars = Param("Entry Bars", 15, 1, 100, 1);

  //EntryBars = Optimize("Entry Bars", 15, 1, 100, 1);



  And here is where I stand right now:



  function ParamOptimize( EntryBars, 15, 1, 100, 1)

  {return Optimize (EntryBars, Param EntryBars, 15, 1, 100, 1),1, 100, 1);};



  which is not working. I have tried variations but obviously 

  I am not a programmer.



  Thank you,

  James



------------------------------------------------------------------------------
  Now that's room service! Choose from over 150,000 hotels 
  in 45,000 destinations on Yahoo! Travel to find your fit.  
Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.19/663 - Release Date: 2/1/2007 2:28 PM