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

Re[2]: [amibroker] How to use AddCustomMetric() to add external values



PureBytes Links

Trading Reference Links

Title: Re[2]: [amibroker] How to use AddCustomMetric() to add external values

Thanks, but i don't understand how to do that. Tried a number of ways but it doesn't work.


Could you show me where to add Foreign in my example code below?


Your help is much appreciated!

herman



Tuesday, November 4, 2008, 7:48:33 AM, you wrote:


>

You need to use foreign

CBT doesnt have a "current" ticker.




From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Herman

Sent: Tuesday, 4 November 2008 8:32 PM

To: AmiBroker User Group

Subject: [amibroker] How to use AddCustomMetric() to add external values


I want to simply add numerical values (in columns) from an external function to the BT report. 


1) Can someone tell me why the code below does not work? Also, what is the minimum code to accomplish this?

2) Is it possible to add a text column?


Thanks,

herman


function Test()

{

    return LastValue( Open );

}


SetOption( "UseCustomBacktestProc", True );


if ( Status( "action" ) == actionPortfolio )

{

    bo = GetBacktesterObject();

    bo.PreProcess();


    for ( bar = 0; bar < BarCount; bar++ )

    {

        bo.ProcessTradeSignals( bar );

    }


    T = Test();


    bo.PostProcess();

    bo.AddCustomMetric( "Test", T );

}


// My trading system would be here

Short = Cover = 0;

Buy = Cross( MACD(), Signal() );

Sell = Cross( Signal(), MACD() );


 

 

__._,_.___

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL 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

*********************************




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___