Thank you very much, Mike. I was close, but the negative values threw 
me off.  I had it like so:

Offset = Optimize("Offset", -.10, -.10, -.25, .05);
Buy = Close <= MA(Close, Periods) Offset;

Apparently AB doesn't like it that way.  ;-) 

Thanks again,

Grant



--- In [email protected], "Mike" <[EMAIL PROTECTED]> wrote:
>
> Refer to Optimize reference here: 
> http://www.amibroker.com/guide/afl/afl_view.php?id=107
> 
> e.g. Continuing with the example at hand...
> 
> "Optimize for periods between 50 - 100 days, incrementing by 25 
days 
> (with a default of 50 days when not optimizing), and a drop of 10 
> cents - 25 cents, incrementing by 5 cents (with a default of 10 
cents 
> when not optimizing)".
> 
> Period = Optimize("Period", 50, 50, 100, 25);
> Offset = Optimize("Offset", 0.10, 0.10, 0.25, 0.05);
> Buy = Close <= MA(Close, Periods) - Offset;
> 
> The above would give you many redundant buy signals that you might 
> have to remove (via ExRem) depending on your backtesting mode. If 
> using the default backtester mode, AmiBroker will handle that for 
you.
> 
> Alternatively, you could use the Cross function and avoid the 
> duplicate signals, found here:
> http://www.amibroker.com/guide/afl/afl_view.php?name=cross
> 
> Mike
> 



Reply via email to