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

Re: [amibroker] Re: Looping question



PureBytes Links

Trading Reference Links




Hi Jayson, you are welcome. I have tested mine 
(basically the same as Ace's) and confirmed it matches cum(v) though there is a 
small difference when the values get very big. I think that's due to the 
conversion between float and integer, not an error. - Mark H.
 
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Jayson 
  
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Sunday, December 07, 2003 11:39 
  PM
  Subject: RE: [amibroker] Re: Looping 
  question
  
  <FONT face=Arial color=#0000ff 
  size=2>Thank you all (Ace, Mark, Graham and Dingo) for the lightning fast 
  service :)  
   
  Regards, 
  Jayson 
  <FONT face=Tahoma 
  size=2>-----Original Message-----From: acesheet 
  [mailto:acesheet@xxxxxxxxx]Sent: Sunday, December 07, 2003 11:26 
  PMTo: <A 
  href="">amibroker@xxxxxxxxxxxxxxxSubject: 
  [amibroker] Re: Looping questionJayson,One 
  thing to note is that AB is a zero-based array coordinate program so 
  sometimes the loop starts at i=0. For this case you simply need to 
  account for the first value of volume in your total. I think you should 
  try something like this:for( i = 1; i <BarCount ; i++ 
  ){if(i==1) x[0]=Volume[0];x[i] = x[i-1] + 
  Volume[i];}plot(x,"Test",5);-ace--- In 
  amibroker@xxxxxxxxxxxxxxx, "Jayson" <jcasavant@xxxx> wrote:> I am 
  trying to get my mind wrapped around looping could some please 
  explain> to me why the following code does not reflect the same thing 
  as cum(v)?> > x=0;> > for( i =1; i 
  <BarCount ; i++ )> > {> > x = x 
  +Volume;> > }> > plot(x,"Test",5);> 
  > It "seems" like I am saying " x= the last value of x plus volume" 
  and that> would continue to increment by each days volume until the 
  last bar. Of> course that is not happening at all. I am sure I am 
  missing something> simple...any help appreciated> > 
  Regards,> JaysonSend 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. 
  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.