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

RE: [amibroker] Re: size of an array in AFL?



PureBytes Links

Trading Reference Links




<SPAN 
class=355190618-25102003>actually, the more I thought about it, the more I saw 
problems. first off, wouldn't a value of -1 return false for IsTrue()?. second, 
I wasn't thinking only of price etc arrays, but arrays in general, ones I might 
use for anything (top N tickers and their RSI/Stoch/SomeStat values, whatever). 
beyond the idea that arrays may contain empty values, I wanted to 
find the size beyond which no element exists at all. 

<SPAN 
class=355190618-25102003> 
<SPAN 
class=355190618-25102003>as far as I know and am hearing, since I'm managing the 
contents of the array in the first place, the best way to do that is to keep 
track of their size externally. I'd prefer to write functions that operate on 
any passed array, looping through it or whatever, and don't need to be told how 
big it is by the code that created it. but that's a matter of style, not 
capability. I can cope. 
<SPAN 
class=355190618-25102003> 
<SPAN 
class=355190618-25102003>if there is some AFL alternative, I'd love to hear it, 
but it's no big deal.
<SPAN 
class=355190618-25102003> 
<SPAN 
class=355190618-25102003>dave
<BLOCKQUOTE 
>You 
  should decide if you consider the {empty} part into the "size" of an 
  arrayor not.StochD(50) is not defined [it is empty] for many bars in the 
  beginning. Does the empty part belongs to the size of the array ?The 
  answer is not that simple and may lead to confusion.The 
  array=log((cum(1)-300)*(cum(1)-500)) is not defined [empty] from the 
  300th to the 500th bar. What is the size of this array ?A quantity 
  should exist first and then speak for its size.Do not confuse the 
  existence of an array with the way amibroker plots the array. Amibroker 
  "knows" the data lenght of a symbol and plots all functions according to 
  this "size".  If IBM has 900 data in your database and you select IBM 
  from your symbol tree, then all the arrays would have size=900. If, in the 
  same database INTC has 899 data, then the same arrays will have a new 
  "size"=899. This would lead to contradiction about the real size of an 
  MA(C,10) array.Dimitris Tsokakis--- In amibroker@xxxxxxxxxxxxxxx, 
  "Dave Merrill" <dmerrill@xxxx> wrote:> thanks dimitris, I 
  like it. simple and direct.> > dave>   
  Dave,>   for an array X the size is 
  Cum(IsTrue(X))>   I suppose here  you are not interested 
  for the {empty} bars.>   If you need to include the empty 
  bars also, then the size is simply >   
  Cum(1).>   [Both above are 1-basis 
  counting]>   Dimitris Tsokakis>   --- In 
  amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx> 
  >   wrote:>   > in most languages, it's 
  possible to find out the size of an array >   
  directly,>   > by examining some property of the array 
  itself or applying some >   function to>   
  > it, without having to know how it was created. some examples 
  are:>   > >   
  >     array.length>   
  >     array.size>   
  >     SizeOfArray(array)>   > 
  >   > is that possible in AFL? if not, it can be worked 
  around since we >   do in>   > 
  general know how every array was created, but it's less elegant and 
  >   less>   > self 
  contained.>   > >   > 
  dave>   > >   >   I'm not 
  sure how to answer this because it depends on which array 
  >   you are>   > refering 
  too.>   > >   >   Are you 
  refering to a stock data array of some description? If so 
  >   you>   > could use the Barcount 
  constant which will return the number of >   bars in 
  the>   > array. Remember it's zero based so the last bar 
  is refered to as: >   Barcount ->   > 
  1>   > >   >   
  Regards,>   >   William 
  Peters>   >   www.amitools.comSend 
  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.