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

[amibroker] Re: Ignore systems with too few trades during optimization



PureBytes Links

Trading Reference Links

What this code is is really an simple moving average auto-optimizer
under an exploration.  It is the same as using the optimizer yourself
one time for each of your securites, and then discriminating between
the results.

The way you should use it is to run it in AA under exploration. 
Select "All symbols".  And then what this will do is optimize each
security in your database for a moving average.  If it meets the
criteria, it will spit out the symbol, etc.  The "FOR" loop is simply
managing the moving average in days, just like an optimization would
(range(a/k/a days) = optimize ("range",15,5,100,1);    Doing it this
way is just more efficient coding (IMHO).  If you wanted to do a
double cross moving average, you would add a second FOR loop, although
that gets kinda long!

Think of this code as a survey of the market.  Once you find a
security you like, then you can go into optimization on the individual
security and tweak the system to be optimal for your trading style.

This is a system just like any other moving average system.  For extra
mileage, replace MA with EMA, DEMA, TEMA, WMA, etc.  Add stops, bands,
whatever.  However, just because it spits out a historically
profitable system (and it should, because that's what the code tells
us to do - ignore unprofitable systems).

If you find a way to improve the exploration, please post it for the
rest of us.

regards,

-S
--- In amibroker@xxxxxxxxxxxxxxx, eric paradis
<thechemistrybetweenus@xxxx> wrote:
> I added some money management and backtested this
> system with trade delays 1,1,1,1 and it looks
> profitable. My question is, is this really a system?
> Seeing how it searchs for trades with the For loop, I
> find it hard to follow that it is in fact a system.
> 
> Any thoughts? 
> 
> Eric 
> --- drsinfla <drsteph@xxxx> wrote:
> 
> > --- In amibroker@xxxxxxxxxxxxxxx, "John Larsson"
> > <amibroker@xxxx> wrote:
> > > Sometimes when optimizing, a solution with just a
> > few trades emerges as 
> > > the best. This is probably not an interesting
> > solution, because there 
> > > is no general capability built into it. It just
> > captures a single or a 
> > > few very good moves. I'd like to skip these
> > solutions.
> > >  
> > > Is there a way to tell AmiBroker to ignore systems
> > with les than N (30 
> > > or so) trades during optimization? 
> > > Thanks,
> > > John
> > 
> > Do you mean this exploration? ( I thinks so...)
> > 
> >
> --------------------------------------------------------
> > bestequity = 0;
> > bestrange = 0;
> > 
> > // optimization loop
> > 
> > for( range = 5; range < 100; range ++ )
> > {
> > 
> >   Buy = Cross( Close, MA( Close, range ) );
> > 
> >   Sell = Cross( MA( Close, range ), Close );
> > 
> >  Le = LastValue( Equity() );
> > 
> >   if( Le > bestequity )
> >   { 
> >    bestequity = Le;
> >    bestrange = range;
> >  }
> > }
> > 
> > range = bestrange;
> > 
> > Buy = Cross( Close, MA( Close, range ) );
> > 
> > Sell = Cross( MA( Close, range ), Close );
> > 
> > Filter = (BarIndex() == BarCount - 1) AND
> > Equity()>20000 AND
> > Equity()<1000000 AND Cum(Buy)>20;
> > //assuming risk free rate of return of 5% p.a. you
> > need to make >$2000
> > profit to justify risk
> > //and you should really expect $4000 for a
> > reasonable (10%) return
> > //and if you don't have at least 20 trades, forget
> > it.
> > 
> > AddColumn( bestrange, "Best range" );
> > 
> > AddColumn( Equity(), "Best Equity" );
> > 
> > AddColumn(Cum(Buy),"number of trades");
> > 
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com




------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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 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/

<*> 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/