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

Re: [amibroker] Re: System development tutorial by Herman van den Bergen



PureBytes Links

Trading Reference Links

Answering my own post here for anyone else who comes along.

Regards to question #1 - use the Cum(buy) function to count # of 
trades.  This works ok for a moving average - may need to use an 
EXREM(buy) for other systems prone to generating multiple signals.

Change Filter line to:

Filter = (BarIndex() == BarCount - 1) AND Equity()>14000 AND Cum(buy)
>10;

& then add a column to see how many trades under the exploration at 
end (last line)

AddColumn(Cum(Buy),"number of trades");

Jury is still out on #2 -I think it can be done using equity() 
processing the array itself to get # of up equity trades and # of 
down equity trades to give me the winners percentage, but haven't 
figured out how yet.

#3, still no clue.

Stephen

--- In amibroker@xxxxxxxxxxxxxxx, "drsinfla" <drsteph@xxxx> wrote:
> I've been playing around with the for loop optimization done under 
> exploration from a prior 2003 post... 
> 
> Wondering how I would add the following criteria to the optimized 
> exploration in this fashion:
> 
> 1.  Only display securities which have >10 trades in the time 
period 
> analyzed
> 
> 2.  Only display securities which have >50% winning trades
> 
> 3.  Write a column showing maxDD.
> 
> Any ideas?  Code follows:
> 
> ************************************
> 
> 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()>14000;
> 
> AddColumn( bestrange, "Best range" );
> 
> AddColumn( Equity(), "Best Equity" );



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/