Did you try it using the individuak backtester ?

----- Original Message -----
From: Herman 
Date: Thursday, July 24, 2008 2:51 pm
Subject: RE: [amibroker] Re: How to save Metrics in Composites for Individual 
BTs
To: [email protected]

> Thanks Mike,
> 
> I tried that and various other things, changed the ATCFlags for 
> Backtester,used actionBacktest, etc. No Go.
> 
> thanks,
> herman
> 
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED]
> Behalf Of Mike
> Sent: July 24, 2008 2:28 PM
> To: [email protected]
> Subject: [amibroker] Re: How to save Metrics in Composites for
> Individual BTs
> 
> 
> Herman,
> 
> If running the script using the Backtest on individual symbols (i.e.
> not as portfolio), couldn't you just construct the name as part of
> the script?
> 
> Sorry that I haven't actually tried this out first (no AmiBroker on
> this machine). But, I believe the script would only ever apply 
> to a
> single ticker at a time. If so, it should work.
> 
> Mike
> 
> e.g.
> 
> // Demo trading system
> Short = Cover = 0;
> Buy=Cross( MACD(), Signal() );
> Sell=Cross( Signal(), MACD() );
> 
> atcName = "~~~UI_"+Name(); // <-- Name of single ticker in use
> 
> // Using the CBT to retrieve/save metrics
> SetOption("UseCustomBacktestProc", True );
> if( Status("action") == actionPortfolio )
> {
> bo = GetBacktesterObject();
> bo.PreProcess();
> MyHistStat1 = Null;
> 
> for(bar=0; bar < BarCount; bar++)
> {
> bo.ProcessTradeSignals( bar );
> stats = bo.GetPerformanceStats( 0 );
> MyHistStat1[ bar ] = stats.GetValue("UlcerIndex"); // any metric
> }
> 
> bo.PostProcess();
> AddToComposite( MyHistStat1, atcName, "X", atcFlagEnableInPortfolio
> | atcFlagDefaults ); // <-- Signals are all on single ticker at 
> a time
> }
> 
> PlotForeign(atcName, "UlcerIndex Historical", colorRed, 
> styleLine );
> 
> 
> --- In [email protected], "Herman" wrote:
> >
> > Some time ago Tomasz posted the code below (simplified) on the KB.
> Would
> > anyone know how to modify this code to save the metrics for
> individually
> > backtested tickers? Composites would be named like 
> "UI_"+Name(). I
> want to
> > run individual backtests over a watchlist and save ticker-specific
> metrics
> > in composites. The metrics would be read/used in another trading
> system.
> >
> > many thanks for any help you can give!
> > herman
> >
> > // Demo trading system
> > Short = Cover = 0;
> > Buy=Cross( MACD(), Signal() );
> > Sell=Cross( Signal(), MACD() );
> >
> > // Using the CBT to retrieve/save metrics
> > SetOption("UseCustomBacktestProc", True );
> > if( Status("action") == actionPortfolio )
> > {
> > bo = GetBacktesterObject();
> > bo.PreProcess();
> > MyHistStat1 = Null;
> >
> > for(bar=0; bar < BarCount; bar++)
> > {
> > bo.ProcessTradeSignals( bar );
> > stats = bo.GetPerformanceStats( 0 );
> > MyHistStat1[ bar ] = stats.GetValue("UlcerIndex"); // any metric
> can be
> > retrieved
> > }
> >
> > bo.PostProcess();
> > AddToComposite( MyHistStat1, "~~~UI_HISTORICAL", "X",
> > atcFlagEnableInPortfolio | atcFlagDefaults );
> > }
> >
> > PlotForeign("~~~UI_HISTORICAL", "UlcerIndex Historical", colorRed,
> > styleLine );
> >
> 
> 
> 
> ------------------------------------
> 
> 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
> 
> 
> 
> 
> 

Reply via email to