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

Re: [amibroker] Re: Watchlist Name



PureBytes Links

Trading Reference Links

Hi Ara --

Does the function

CategoryGetName(CategoryWatchlist,n);

work for you?

Thanks,
Howard



On Sat, Sep 27, 2008 at 11:09 PM, Mike <sfclimbers@xxxxxxxxx> wrote:

Don't know if there is an easier way. But, you could always just use
the Com/JScript support to access the AmiBroker OLE object and query
its properties as follows.

Mike

EnableScript("jscript");

<%
function getAAWatchList() {
var ab = new ActiveXObject("Broker.Application");
var aa = ab.Analysis;

return aa.Filter(0, "watchlist");
}
%>

Fast = MA(Close, 5);
Slow = MA(Close, 25);
PositionSize = -10;

Buy = Cross(Fast, Slow);
Sell = Cross(Slow, Fast);

SetBacktestMode(backtestRegular);
SetCustomBacktestProc("");

if (Status("action") == actionPortfolio) {
script = GetScriptObject();
bo = GetBacktesterObject();

bo.Backtest();
bo.AddCustomMetric("Watchlist", script.getAAWatchList());
}

Documentation for JScript support:
http://www.amibroker.com/guide/a_aflcom.html

Documentation for OLE model:
http://www.amibroker.com/guide/objects.html



--- In amibroker@xxxxxxxxxxxxxxx, "Ara Kaloustian" <ara1@xxx> wrote:
>
> Is there an AFL function to read the name of the current watchlist
(or market etc) that the AA is currently set on?
>
> I want to add the name of the watchlist as a custom metric with
CBI, but have not found how to locate what watchlist AA is set on.
>
> tx
>
> Ara
>


__._,_.___

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

__,_._,___