[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

--- 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");




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/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/