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

[amibroker] Re: Watchlist Name



PureBytes Links

Trading Reference Links

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

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