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

[amibroker] Adding exit bar Close via AddCustomMetric



PureBytes Links

Trading Reference Links

I am trying to add a few columns to my Backtest results page.  I'd 
like to add the exit bar open and close price and the previous bar's 
close price to the output (per trade).

One apparent limitation is that the GetPrice command only works with 
the Open Trade list.  Additionally, I've never been able to get the 
AddCustomMetric to work inside a bar-by-bar loop inside the trade 
object.  I've tried the following, but it didn't work.  Any help 
would be appreciated.


SetCustomBacktestProc(""); 					
		
if( Status("action") == actionPortfolio ) 
{ 
    bo = GetBacktesterObject(); 
    bo.preprocess();
	
    for( bar = 0; bar < BarCount ; bar++ )
	{
	 bo.ProcessTradeSignals(bar);
	 for( Openpos = bo.GetFirstOpenPos() ; OpenPos ; OpenPos = 
bo.GetNextOpenPos() )
		{
		  xClose= trade.GetPrice(bar, C );
		}

	 bo.AddCustomMetric("Close", xClose, DecPlaces = 2  );  
		
	}
	bo.PostProcess();







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Home is just a click away.  Make Yahoo! your home page now.
http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/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/