|
I clipped this from one of my routines and I think this will work if the individual watchlists 1...10 contain the tickers from which the indexes are composed. 1) Select a current symbol with a suitable number bars 2) Select n last quotations = 1 3) Run as a SCAN Ths should produce 10 tickers ~WLAvg1 to ~WLAvg10 with the average volume in the Volume field.You choose how you want to average the price arrays. Hope this helps Joe
VolTotal = Count = CountVol = 0; for (j =1 ; j<=10; j++){ //_TRACE("WL # " + j); watchlistsymbols = GetCategorySymbols(categoryWatchlist, j); for (mem = 0; (member = StrExtract(watchlistsymbols, mem)) != ""; mem++) { ticker = Foreign(member, "Close"); //_TRACE("Ticker "+ ticker+" no of member "+ mem); tickvol = Nz( Foreign(member, "Volume") ); VolTotal = Voltotal + tickvol; countvol = countvol + IIf(IsEmpty(ticker), 0, 1); } IndexVolavg = voltotal / countvol; // Here generate a symbol name for example "~WLAvg01 to "~WLAvg10" Listnum = j; // for readability if (Listnum < 10) Listnumstr = StrFormat("%1.0f", Listnum); else Listnumstr = StrFormat("%2.0f", Listnum); AddToComposite(indexvolavg, "~WLAvg" + Listnumstr, "V", atcFlagDefaults + atcFlagEnableInExplore); } Buy = Sell = 0; ----- Original Message -----__._,_.___ Please note that this group is for discussion between users only. To get support from AmiBroker please send an e-mail directly to SUPPORT {at} amibroker.com For other support material please check also: http://www.amibroker.com/support.html
SPONSORED LINKS
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 __,_._,___ |
- [amibroker] Composite Calculations - help Bill
- RE: [amibroker] Composite Calculations - help Terry
- Re: [amibroker] Composite Calculations - help Joe Landry
- [amibroker] Re: Composite Calculations - help Sanjay
