Hi RZ --

My book "Quantitative Trading Systems" discusses objective functions in
general, the importance of choosing one early in the system design process,
the metrics built-in to AmiBroker, the process of designing multi-component
custom objective functions, the custom backtest code necessary to implement
custom objective functions, and the use of objective functions in
optimization and walk forward testing.

The objective function incorporates the subjective aspects of trading
systems.  Proper choice of the objective function guarantees that trading
systems that are highly ranked by the search process and chosen by the walk
forward process will be comfortable to trade.  It would be difficult to
overemphasize the importance that proper selection of objective function
plays in trading system development.

http://www.quantitativetradingsystems.com/

Thanks,
Howard

On Fri, Jun 11, 2010 at 9:00 PM, i cs <ics4...@yahoo.com.au> wrote:

>
>
> Thank you Howard, re_Rowland and Mike
>
> Was trying to avoid the CBT but it looks like I gotta dive in.
>
>
> BTW Howard, which of your books would best cover this level of experience?
>
> Thanks for your help again
>
> RZ
>
>
> ------------------------------
> *From:* Howard B <howardba...@gmail.com>
> *To:* amibroker@yahoogroups.com
> *Sent:* Sat, 12 June, 2010 2:39:54 AM
> *Subject:* Re: [amibroker] Limiting Drawdown in a Backtest
>
>
>
> Hi RZ --
>
> You can do this by creating a custom objective function.
>
> It could as simple as assigning the custom function a value of 0 whenever
> the parameter set results show maximum system drawdown exceeds 30%.
>
> Try this:
>
> //////////// ///////// ///////// ///////// //
>
> //    LimitDrawdown. afl
> //
> //    Use CustomBacktester to limit
> //    drawdown in trading systems.
> //
> //    Howard Bandy
> //    June 2010
> //
> OptimizerSetEngine( "cmae" );
>
> //    The custom backtest code
> //    to penalize results that do not
> //    meet your specifications
>
> DesiredDDLimit = 30;
>
> SetCustomBacktestPr oc( "" );
>
> if ( Status( "action" ) == actionPortfolio )
> {
>     bo = GetBacktesterObject ();
>     bo.backtest( );
>     st = bo.getperformancest ats( 0 );
>
>     MaxSysDD = abs( st.getvalue( "MaxSystemDrawdownPe rcent" ) );
>     NetProfPct = st.getvalue( "NetProfitPercent" );
>     ObFn = ( MaxSysDD < DesiredDDLimit ) * NetProfPct;
>     bo.addcustommetric( "FilteredNetProfit", ObFn );
> }
>
>
> //    The Buy and Sell signals
>
> MA1Len = Optimize( "MA1Len", 5, 1, 100, 1 );
>
> MA2Len = Optimize( "MA2Len", 20, 1, 100, 1 );
>
> MA1 = EMA( C, MA1Len );
>
> MA2 = EMA( C, MA2Len );
>
> Buy = Cross( MA1, MA2 );
>
> Sell = Cross( MA2, MA1 );
>
>
>
> e = Equity();
>
> Plot( e, "E", colorGreen, styleLine );
> //////////// ////// end //////////// ////////
>
> //////////// ///////// ///////// ///////// /
>
> Thanks,
> Howard
>
>
> On Fri, Jun 11, 2010 at 6:37 AM, ics4mer <ics4...@yahoo. 
> com.au<ics4...@yahoo.com.au>
> > wrote:
>
>>
>>
>> Hi,
>>
>> Doing a bit of backtesting lately, and I was wondering how to limit the
>> drawdown while using another metric for the objective function.
>>
>> Lets say that I want to optimize for Net Profit, but I won't accept
>> parameter sets that result in a drawdown of more than 30%
>>
>> I know it can be done (AB does anything).
>>
>> Could somebody give me a pointer please?
>> I can't find explicit references to it in the archive, and I don't think
>> I'm ready for some of the more intricate parts of the CBT.
>>
>> TIA
>>
>> RZ
>>
>>
>
>
> 
>

Reply via email to