[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] BarCount problem... (Was: Re: Strange behavior...)



PureBytes Links

Trading Reference Links

TJ,

The problem I'm experiencing seems to be related to BarCount's value. 
I'm seeing following behavior with multiple databases.

If I plot BarIndex() and BarCount values (with default DB that came 
with the install) as -

Plot(BarIndex(), "BI", colorBlue);
Plot(BarCount, "BC", colorRed);

- what I see is that BC starts with 159 at the start of the chart, 
increases by 1, until it reaches 189 and stays there. In the 
meanwhile, BI starts with zero, crosses BC at 189, and goes all the 
way to 356.

Isn't BC always supposed to be 357? Do you have any idea what could 
be causing this? Like I said, I see similar behavior with any DB that 
I use. I'm using 4.41 Beta (built on 9/2).

Another interesting thing to note is that when I insert this 
indicator, BC does show 357 as the value, but as soon as I click 
anywhere in the chart, it shows the values as described above.

TIA.

Jitu

--- In amibroker@xxxxxxxxxxxxxxx, "jtelang" <jtelang@xxxx> wrote:
> Typo in the pseudo-code. It should read -
> 
> -------
> 
> handle = LoadTableAndGetHandle();
> col = GetWhichColToDisplay();
> val = 0; // Value to display
> 
> for( i = 0; i < BarCount; i++ ) {
>   val[i] = GetValFromTable(handle, i, col); // i being the row
> }
> 
> ------
> --- In amibroker@xxxxxxxxxxxxxxx, "jtelang" <jtelang@xxxx> wrote:
> > TJ,
> > 
> > I'm using a ABTool-managed, externally stored table to store some 
> > calculated data for each symbol. When I try to display a value in 
> the 
> > column from an indicator, I see a rather strange behavior. Say my 
> > indicator is something like following pseudo-code -
> > 
> > ----------
> > 
> > handle = LoadTableAndGetHandle();
> > col = GetWhichColToDisplay();
> > val = 0; // Value to display
> > 
> > for( i = 0; i < BarCount; i++ ) {
> >   val = GetValFromTable(handle, i, col); // i being the row
> > }
> > 
> > -----------
> > 
> > When I first time insert this indicator, a plot gets created with 
> > values shown. However as soon as I click somewhere else in the 
> chart, 
> > all values displayed drop to zero (may be because I initialized 
it 
> to 
> > zero?). Then onwards, if I click "Edit Formula" again and hit 
> Apply, 
> > the values flash on the chart for a fraction of a second, and 
then 
> > disappear.
> > 
> > I'm not sure if this is ABTool problem (I've posted a question on 
> > their list to figure out what the best way to display the values 
> is), 
> > but what could cause the chart to behave this way? I've tried a 
> > number of things, such as defining handle as "handle[0]" to see 
if 
> it 
> > loads the file only once, or just loading it inside the loop only 
> > when "i == 0" and then reusing the handle value, etc, but to no 
> avail.
> > 
> > Any ideas?
> > 
> > TIA,
> > 
> > Jitu


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/