Joe - Thank you for letting me both "lean and learn" from you. I just wasn't catching a clue as the how the increment worked but now I see why it starts at 7. I didn't realize you could use this inside the watchlist portion. This will come in very useful for something I was thinking about trying.
Thanks DM --- In [email protected], "Joe Landry" <[EMAIL PROTECTED]> wrote: > > You can lean on me......^--^ > > As i is incremented from 0 to 9 (there are 9 symbols in the list string > SYMBOLS) > until it senses the end of the list. > > the logic will test to see if the symbol is in watchlist 7, 8, 9 . . . . . > 15 > > and if it is in the watchlist it will add Advanced and Declined to the > appropriate addtocomposite array. > > HTH > Joe > > ----- Original Message ----- > From: "dmcleod1981" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Tuesday, October 17, 2006 7:44 PM > Subject: [amibroker] Re: InWatchList and ATC question/problem > > > > Can I use this as a leaning experience... What does the i+7 in the > > code sample if( InWatchList( i + 7 ) ) do? > > > > Why +7? > > > > Thanks > > DM > > > > --- In [email protected], "Tomasz Janeczko" <groups@> wrote: > >> > >> Bill, > >> > >> Your formula will work good if and only if watchlists are mutually > > exclusive > >> (have no common members). Otherwise you would need to > >> put as many addtocomposites as there are watch lists, or build a loop: > >> > >> symbols = "DJ-15,DJ-20,DJ-30,SP-500,MID--X,SML--X,RUI-X,RUT-X,NDX-X"; > >> > >> for( i = 0; ( sym = StrExtract( symbols, i ) ) != ""; i++ ) > >> { > >> if( InWatchList( i + 7 ) ) > >> { > >> AddToComposite( Advanced, "~Adv "+sym,"X" ); > >> AddToComposite( Declined, "~Dec "+sym,"X"); > >> } > >> } > >> > >> > >> > >> Best regards, > >> Tomasz Janeczko > >> amibroker.com > >> ----- Original Message ----- > >> From: "Bill" <zim630@> > >> To: <[email protected]> > >> Sent: Tuesday, October 17, 2006 10:11 PM > >> Subject: [amibroker] InWatchList and ATC question/problem > >> > >> > >> > Hi All, > >> > I've posted something similar to this before and received some > >> > ideas, thanks for those responses. I am by no stretch of the > >> > imagination a programmer, but I am trying to learn. > >> > > >> > I calculate several formula for ATC against indices maintained in > >> > Watch Lists. As an Example: if I use this formula (separate formula > >> > for each index): > >> > YestClose = Ref( Close, -1 ); > >> > Advanced = Close > YestClose; > >> > Declined = Close < YestClose; > >> > > >> > AddToComposite( Advanced, "~Adv "+"MID--X" ,"X" ); > >> > AddToComposite( Declined, "~Dec "+ "MID--X" ,"X"); > >> > > >> > and run it against a watch list containing S&P midcap components > >> > watch list number 11 - Today's result is 109. > >> > > >> > If however I run this against all stocks in the system: > >> > if (InWatchList(07)) sym="DJ-15"; > >> > if (InWatchList(08)) sym="DJ-20"; > >> > if (InWatchList(09)) sym="DJ-30"; > >> > if (InWatchList(10)) sym="SP-500"; > >> > if (InWatchList(11)) sym="MID--X"; > >> > if (InWatchList(12)) sym="SML--X"; > >> > if (InWatchList(13)) sym="RUI-X"; > >> > if (InWatchList(14)) sym="RUT-X"; > >> > if (InWatchList(15)) sym="NDX--X"; > >> > > >> > AddToComposite( Advanced, "~Adv "+sym,"X" ); > >> > AddToComposite( Declined, "~Dec "+sym,"X"); > >> > The result value for today on watchlist 11 MID--X is 1661. > >> > > >> > watch list 11 & 12 give differing results. Watch list 07 thru 09 > >> > return no results at all. The remaining results are identical. What > >> > is going on? What am I missing? > >> > > >> > Any help will be greatly appreciated. > >> > And a Big Thanks in advance. > >> > > >> > Bill > >> > > >> > > >> > > >> > > >> > > >> > 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 > >> > > >> > > >> > Yahoo! Groups Links > >> > > >> > > >> > > >> > > >> > > >> > > >> > > > > > > > > > > > > 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 > > > > > > Yahoo! Groups Links > > > > > > > > > > > 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 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:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
