Graham: thanks for pointing that out, which let me figure out the order issue.
Ken -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Graham Sent: Thursday, July 03, 2008 12:16 AM To: [email protected] Subject: Re: [amibroker] Values "Offset" in Loop Output as RUT is first (0) you get the DJ results in the explore as expected From observation exploration always default sorts the results automatically in symbol name() alpha order. You can change the sorting of explore uisng SetSortColumns( col1, col2, .... ) -- Cheers Graham Kav AFL Writing Service http://www.aflwriting.com 2008/7/3 Ken Close <[EMAIL PROTECTED]>: > This is a simple test I am trying to perform on the way to a more complex > looping system. > I discovered that the following small piece of code produces a weird result > in the AA Window. > The calculated values of RSI inside the loop produce "offset results" when > sent to the AA window via the AddColumn function. > > > AB = CreateObject("Broker.Application"); > > AA = AB.Analysis; > > WL = AA.Filter(0, "WatchList"); > > WLSyms = CategoryGetSymbols(categoryWatchlist, WL); > > > > if (Name() == StrExtract(WLSyms, 0)) > > { > > WLQty = 0; > > for (i = 0; (Symbol = StrExtract(WLSyms, i)) != ""; i++) > > { > > WLQty = WLQty + 1; > > SetForeign(Symbol); > > RSIx = (RSI(14)); > > ROCx = (ROC(C, 14)); > > RestorePriceArrays(); > > } > > } > > RSIn = RSI( 14 ); > > ROCn = ROC(C,14); > > Filter = 1; > > Buy = 0; > > AddTextColumn(Name(),"Name",1.0); > > AddColumn(RSIx,"RSIx",1.2); > > AddColumn(ROCx,"ROCx",1.2); > > AddColumn(RSIn,"RSIn",1.2); > > AddColumn(ROCn,"ROCn",1.2); > > > Notice the 0.00 for RSIx for DJ-30 is the values for RUT-I--the thing is > offset and I can not figure out why or what is causing this to be offset. > The i in the StrExtract command is supposed to be zero based, but the RSIx > array is getting switched (really offset) somehow. > There are only two symbols in the Watchlist. The first symbol in the > Watchlist is RUT-I, while the second is DJ-30, so the order printed is > reversed also. > > > Ticker Date/Time Name RSIx ROCx RSIn ROCn > DJ-30 6/20/2008 DJ-30 0.00 0.00 31.92 -5.29 > DJ-30 6/23/2008 DJ-30 0.00 0.00 31.91 -4.52 > DJ-30 6/24/2008 DJ-30 0.00 0.00 31.11 -4.71 > DJ-30 6/25/2008 DJ-30 0.00 0.00 31.34 -6.29 > DJ-30 6/26/2008 DJ-30 0.00 0.00 24.10 -6.19 > DJ-30 6/27/2008 DJ-30 0.00 0.00 22.43 -7.60 > DJ-30 6/30/2008 DJ-30 0.00 0.00 22.62 -7.65 > RUT-I 6/20/2008 RUT-I 31.92 -5.29 46.59 -2.06 > RUT-I 6/23/2008 RUT-I 31.91 -4.52 44.02 -2.60 > RUT-I 6/24/2008 RUT-I 31.11 -4.71 39.34 -4.81 > RUT-I 6/25/2008 RUT-I 31.34 -6.29 43.87 -6.15 > RUT-I 6/26/2008 RUT-I 24.10 -6.19 37.44 -5.67 > RUT-I 6/27/2008 RUT-I 22.43 -7.60 37.35 -5.05 > RUT-I 6/30/2008 RUT-I 22.62 -7.65 34.57 -5.86 > > While you may not be that interested, I am attempting to modify some code > that FredT gave me here where I wanted to get the ordinal rank numbers for > symbols based on an indicator's value. Fred's code produced this just fine > for the last date in the From-To Range. I would like to modify the code > approach to calculate Rank Ordinals for each Bar, and this modification was > a step towards trying to accomplish that. But seeing the unexpected result > has me stopped. > > Anyone care to speculate on what is going on? > > Thanks, > > Ken > ------------------------------------ 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 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
