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

Re: [amibroker] Re: Watch Lists



PureBytes Links

Trading Reference Links

Hello Dimitris,


> a.
> "But... where?" 
> Is there anything else exept AA ? I did not get the question.
Yes there are many places:
1. Automatic Analysis window
2. Quick Review window
3. Tree - view
4. Automation scripting

> b.
> To make it clear if it was not:
> I run an Exploration with daily settings.
> Results are placed to Watchlist1.
> I run the same Exploration with weekly settings.
> Results are placed to Watchlist2.
> I want to find stocks belonging to Watchlist1 AND Watchlist2.
> (AND here is considered as Logical AND)
> Is there any script to read W1 and W2 and find the common names?
If you mean AFL scan script, here it is:

EnableScript("jscript");

ticker = name();
<%
// the following are indexes of watch lists to check 0..31
List1 = 1; 
List2 = 3;

matchbits = (1 << List1) | ( 1 << List2 );

oAB = new ActiveXObject("Broker.Application");


AFL("match") = ( oAB.Stocks( AFL( "ticker" ) ).WatchListBits & matchbits ) == matchbits;
%>

buy = match AND cum(1) == 1; 


Note:
Change List1 and List2 variable assignments to match the indexes of watch lists in question.
Run AA scan to see the list of stocks belonging to both List1 and List2.

Best regards,
Tomasz Janeczko
===============
AmiBroker - the comprehensive share manager.
http://www.amibroker.com