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

[amibroker] Making multiple composites in a single scan



PureBytes Links

Trading Reference Links

Thought I might share this with others, realising it is not rocket science
but maybe some newbies are not aware of doing this. 
I have 3 watchlists comprised from stocks from 3 industry sectors. I create
an index chart and advance decline for each, plus an overall set for the
combined 3 lists. In this I have the first watchlist as a combined one of
all stocks in the lists and the individual sector watchlists in nos 1,2,3.
I may not have made the scan as easy as I may have, but it does the job
after it kept growing and changing. So maybe some things are in it not
required, or could be shortened.
Hope this helps someone as a starting point.

//Make Index of my Watch Lists

xyz = WriteIf(InWatchList(1), "~energy", WriteIf(InWatchList(2), "~health",
"~mining"));
abc = WriteIf(InWatchList(1), "~energyad", WriteIf(InWatchList(2),
"~healthad", "~miningad"));
def = "~watchlist";
ghi = "~watchlistad";

stock=1;

Cad = C>Ref(C,-1);
Cde = C<Ref(C,-1);
Cun = C==Ref(C,-1);

Buy=0;
AddToComposite(H,xyz,"H",1+2+4+16);
AddToComposite(L,xyz,"L",1+2+4+16);
AddToComposite(O,xyz,"O",1+2+4+16);
AddToComposite(C,xyz,"C",1+2+4+16);
AddToComposite(V,xyz,"V",1+2+4+16);
AddToComposite(stock,xyz,"I",1+2+4+16);
AddToComposite(Cad,abc,"H",1+2+4+16);
AddToComposite(Cde,abc,"L",1+2+4+16);
AddToComposite(Cun,abc,"C",1+2+4+16);

AddToComposite(H,def,"H",1+2+4+16);
AddToComposite(L,def,"L",1+2+4+16);
AddToComposite(O,def,"O",1+2+4+16);
AddToComposite(C,def,"C",1+2+4+16);
AddToComposite(V,def,"V",1+2+4+16);
AddToComposite(stock,def,"I",1+2+4+16);

AddToComposite(Cad,ghi,"H",1+2+4+16);
AddToComposite(Cde,ghi,"L",1+2+4+16);
AddToComposite(Cun,ghi,"C",1+2+4+16);
AddToComposite(stock,ghi,"I",1+2+4+16);

Cheers,
Graham
http://groups.msn.com/ASXShareTrading
http://groups.msn.com/FMSAustralia


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/