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

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



PureBytes Links

Trading Reference Links

Herman,

As Mike mentioned, the price arrays are not available in the custom
backtester. One of the challenges of using the CBT is how to get data
into it. There are multiple ways to make the data available:

* Foreign
* PositionScore
* PositionSize
* StaticVar

The PositionScore and PositionSize arrays are accessed differently
in the CBT. They are available at each bar as properties of the
signal object. For example:

lastBar = BarCount-1;
sig = bo.GetFirstSignal(lastBar);
ticker = sig.Symbol;
number1 = sig.PosSize; // PositionSize at this bar
number2 = sig.PosScore; // PositionScore at this bar

I have not tried using StaticVars in the CBT, but I expect it will
work for your purpose, since I believe you do not need an array.

Hope this helps,
Steve


------------------------------------

**** 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

*********************************
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/