Thanks Dennis. I think I was getting confused because I was debugging an indiactor with DeBugView and I could see that the indicator code was being called when I changed the selector line and was being called with BarCount-1 = to the position of the selector line.
Anyway I think the easiest way maybe to just use Ref(Array,-1). Thanks --- In [email protected], Dennis Brown <[EMAIL PROTECTED]> wrote: > > Hello, > > I do the following at the start of my AFLs: > > Global LastBar; > LastBar = BarCount-1; > > Then I use LastBar everywhere I would use BarCount-1. It always > points to the Last "Visible" bar on my charts. The selected bar has > no effect on it. Experiment. > > Best regards, > Dennis > > On May 7, 2008, at 3:07 PM, sidhartha70 wrote: > > > Yup. Read that Mike. About 3 times. Still not clear to me. > > > > Can anyone give me some more color...? Specifically with reference to > > knowing which bar I'm at right now...? i.e. if I use BarCount-1 as I > > mentioned, moving the selector line seems to change the value of > > BarCount-1 hence I'm no longer at te right edge of the chart... > > > > I'm probably just confused. But color would be great... > > > > --- In [email protected], "Mike" <sfclimbers@> wrote: > >> > >> See the user guide for an explanation: > >> > >> http://www.amibroker.com/guide/h_understandafl.html > >> > >> Mike > >> > >> --- In [email protected], "sidhartha70" <sidhartha70@> > >> wrote: > >>> > >>> Hi Tomasz, > >>> > >>> Thanks for answers to previous questions. > >>> > >>> I have a general question which keeps getting me confused. I come > >> from > >>> the world of C# and I find myself always thinking about processing > >>> array elements in the form Array[x] and carrying out calculations > >>> across arrays in that form. Obviously you don't often need to do > >> this > >>> with AFL. > >>> > >>> However, couple of things. If I am using a formula where the > >> currently > >>> calculated value of the array uses it's value 1 bar ago, of the form > >>> in traditional C#, > >>> > >>> Array[x]=100*Array[x-1] > >>> > >>> for example. > >>> > >>> How do I reference the x-1 value of an array in AFL...? The reason I > >>> ask is, previously I have used the BarCount-1 property (thinking > >> that > >>> processing must be happening at the current bar i.e. RHS of chart). > >>> However, I noticed that when I moved the 'selector' line it changed > >>> the value fo BarCount to where ever that line was... hence my > >> forumlas > >>> ended up all wrong. > >>> > >>> I'm sure there's a penny going to drop any minute here... and I'm > >>> going to make the transition from C# to AFL. > >>> > >>> Can you help...? > >>> > >> > > > > > > > > ------------------------------------ > > > > 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 > > > > > > >
