I'm fairly sure that the only way you will get StDev() to accept BarsSince() in 
the 2nd argument without complaining is to force the return of a number by use 
of LastValue() or SelectedValue().  I don't know why Sum() is not complaining 
when BarsSince() is used.  

In the Sum() case, I think that BarsSince( TimeNum ... ) is returning a 
constant array based on the bar you select, including the last bar if no bar is 
selected.  If so, that would work OK but does not explain why StDev() does not 
work.

For Sum(), if you replace TimeNum() with another array generator, for example, 
MA( C, 13 ) == ...., Sum() still does not complain but BarsSince() returns 0 (I 
believe) and, hence, Sum() is 0.

You might have stumbled onto a unique situation but I would not assume that it 
can be generalized and would always go for ensuring the return of a number from 
the 2nd argument whether or not the above is correct.

Bill
  ----- Original Message ----- 
  From: aaryan111 
  To: [email protected] 
  Sent: July 14, 2010 3:08 PM
  Subject: [amibroker] Re: Sum and Stdev , wierd behaviour of stdev


  Hi , thanx for the feedback wave.
  its Syntax is basically to put Period as 2nd argument.
  When u put an array in SUM() as 2nd argument, it will take the corresponding 
scalar frm that array and apply it as a filter.

  i have successfully executed this 

  Sum(Close,BarsSince(TimeNum()>092400));

  regards


  --- In [email protected], "wavemechanic" <olesmi...@...> wrote:
  >
  > Neither takes array as 2nd.  See syntax in Users Guide.
  >   ----- Original Message ----- 
  >   From: aaryan111 
  >   To: [email protected] 
  >   Sent: July 12, 2010 3:41 PM
  >   Subject: [amibroker] Sum and Stdev , wierd behaviour of stdev
  > 
  > 
  >   Hi Everybody, 
  > 
  >   Both Sum() and Stdev() Functions Have same Arguments Structure.but when i 
put 
  >   Sum(Close,BarsSince(TimeNum()>092400))
  >   it executes successfully,while 
  >   Stdev(Close,BarsSince(TimeNum()>092400))
  >   gives a warning " Function Expects Different type of argument here " . 
  > 
  >   as far as i understand , both can take array as 2nd argument and 
amibroker will automatically fetch the current running index value of that 
array as the 2nd argument, same as it does with other functions. 
  > 
  >   one can put any other function returning array like barindex() in 2nd 
argument , result will be same. 
  > 
  >   Any suggestions??
  > 
  >   Regards,
  > 
  > 
  > 
  >   ------------------------------------
  > 
  >   **** IMPORTANT PLEASE READ ****
  >   This group is for the discussion between users only.
  >   This is *NOT* technical support channel.
  > 
  >   TO GET TECHNICAL SUPPORT send an e-mail directly to 
  >   SUPPORT {at} amibroker.com
  > 
  >   TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
  >   http://www.amibroker.com/feedback/
  >   (submissions sent via other channels won't be considered)
  > 
  >   For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
  >   http://www.amibroker.com/devlog/
  > 
  >   Yahoo! Groups Links
  >




  ------------------------------------

  **** IMPORTANT PLEASE READ ****
  This group is for the discussion between users only.
  This is *NOT* technical support channel.

  TO GET TECHNICAL SUPPORT send an e-mail directly to 
  SUPPORT {at} amibroker.com

  TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
  http://www.amibroker.com/feedback/
  (submissions sent via other channels won't be considered)

  For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
  http://www.amibroker.com/devlog/

  Yahoo! Groups Links



Reply via email to