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

Re: [amibroker] Barcount vs BarIndex()



PureBytes Links

Trading Reference Links




Hello,
 
BarIndex() gives true, absolute index of the quotation. It 
does not depend on visible area.
 
BarCount is different. As we can read in the User's Guide, 
what's new in AmiBroker:
 
"added built-in constant 'BarCount' that 
returns number of bars available in arrays (the number of elements of 
array)When QuickAFL is turned on it may be less than true number of bars 
because QuickAFL feature attempts to use only visible bars (and few before). You 
can control how many bars the formula requires using SetBarsRequired() 
function"
 
 
Best regards,Tomasz Janeczkoamibroker.com
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  CS 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Sunday, November 23, 2003 12:52 
  PM
  Subject: [amibroker] Barcount vs 
  BarIndex()
  
  Sheesh,
  You'd think I'd have this figured out, as many times as I've 
  used BarCount but...
   
  BarIndex() doesn't appear to have any relation to 
  Barcount.
   
  I have 5988 bars loaded and view 255 at a time, so 
  plot(BarIndex()) shows 5986 but plot(Barcount) shows 410?
  Where does the 410 come from?
   
  Description for BarCount in the AFL Reference Manual 
  is:
   
  "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. 
  "
   
  Doesn't the 'array' extend from the first bar to the last 
  bar?
  <FONT 
  color=#0000ff> 
  The description for BarIndex() is:
  "returns zero-based bar number - the same as 
  Cum(1)-1 but it is much faster than Cum(1) when used in 
  Indicators"
  <FONT 
  color=#0000ff> 
  Here's where I derailed:
   
  " LineArray( x0, y0, x1, y1, extend = 
  0 )
   
  generates array equivalent to trend 
  line drawn from point x0, y0 to point x1, y1. x 
  coordinates are in bars (zero based)..."
   
  So naturally, I tried:
  y0=LastValue<FONT 
  size=2>(Trough<FONT 
  size=2>(L<FONT 
  size=2>,4<FONT 
  size=2>,2<FONT 
size=2>));
  y1=LastValue<FONT 
  size=2>(Trough<FONT 
  size=2>(L<FONT 
  size=2>,4<FONT 
  size=2>,1<FONT 
size=2>));
  x0=BarIndex<FONT 
  size=2>()-50<FONT 
  size=2>;
  x1=BarIndex<FONT 
  size=2>()-10<FONT 
  size=2>;
  Line = <FONT 
  color=#8b0000>LineArray( x0, y0, x1, y1, 
  0 );
  
  LineArray didn't like that.
  Could someone please expand on the differences and 
  similarities of BarCount and BarIndex()?
  How did BarCount arrive at 
  410?
  Thanks,Corey Saxe
   
   Send 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT 









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 the Yahoo! Terms of Service.