Thanks for your quick help Tomasz. So, BarCount represents the last N bars, where N simply varies depending on the zoom factor.
I understand what you are saying with your example of the 20 years of data. But also, I can certainly conceive of an indicator (or script) that may want a "lookback" to be longer than and independent from the zoom factor. Which is why, I'm sure, there is the SetBarsRequired() function. --- In [email protected], "Tomasz Janeczko" <[EMAIL PROTECTED]> wrote: > > BarCount does not represent number of bars in the DATABASE, > but in the ARRAYs in current execution. > > The arrays have DYNAMIC size depending on zoom factor. That's why BarCount may and will vary. > > For example if you have 20 years of data and you are watching just > the last year > AmiBroker does not need and does not use all bars in the database to calculate > indicators for last year. > > It uses last year only PLUS some previous bars required to "stabilise" indicator values. > The number of extra bars depends on functions you use in the formula. > > If you want to use truly all bars you need to use SetBarsRequired function: > http://www.amibroker.com/f?setbarsrequired > > Best regards, > Tomasz Janeczko > amibroker.com > ----- Original Message ----- > From: "oneklema" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Friday, September 07, 2007 3:45 PM > Subject: [amibroker] Simple question about BarCount > > > >I have what should be a simple question about BarCount but cannot get > > a definitive answer from the AB documentation. FYI, I am working on > > daily data. > > > > What exactly does BarCount represent? The AB help says: > > > > BarCount constant gives the number of bars in array (such as Close, > > High, Low, Open, Volume, etc). Array elements are numbered from 0 > > (zero) to BarCount-1. > > > > So, I understand that it is the size of the arrays (I'm an old C > > programmer). But, I assumed that if I have a loop such as: > > for (i = 0; i < BarCount, i++) > > { > > do work on C[i]; > > } > > > > I would do work on every Close value that is *in the database for the > > symbol that is opened*. But, it does not seem to work this way (?). > > > > When I print out the value of BarCount, I notice that it changes as I > > change the Zoom factor (i.e., clicking +,-). And, the only way to get > > BarCount to reflect all data is to zoom as as far as it can go. So, I > > thought maybe it represents the number of bars displayed as adjusted > > by the zoom. But, from a visual inspection, it is obviously not that > > (maybe related, but not exact). > > > > Is there any way to operate on symbol data for all data that has been > > loaded into the database, regardless of the zoom factor? > > > > > > > > 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 > > > > > > > > > > > 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 <*> 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/
