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

[amibroker] Re: Simple coding question...



PureBytes Links

Trading Reference Links

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

--- In amibroker@xxxxxxxxxxxxxxx, "longarm61" <norm1@xxx> wrote:
>
> Thanks, Louis, appreciate it.  
> 
> Can anyone tell me how to optimize the "10 cents below" part?  I 
> thought I could figure it out, but I'm not getting anywhwere.
> 
> Thanks,
> 
> Grant
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Louis 
> Préfontaine" <rockprog80@> wrote:
> >
> > Hi,
> > 
> > I am not 100% sure, but what about this:
> > 
> > Close<(MA (C, 14))-0.1
> > 
> > Louis
> > 
> > 
> > 2008/2/26, longarm61 <norm1@>:
> > >
> > >   How would I code "buy when price (close) is at least 10 cents 
> below
> > > MA?" I would like to optimize the "10" but I think I can figure 
> that
> > > part out...I think. ;-)
> > >
> > > Thanks.
> > >
> > > Grant
> > >
> > >  
> > >
> >
>




Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/