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

Re: [RT] tangent to AMA



PureBytes Links

Trading Reference Links


Perhaps the first iteration gives a sum value of 
Zero and you are trying to divide by zero. I have not run the numbers though. 
Put a writeln(sum); before to determine what is the sum value before the error 
line
 
Steve
<BLOCKQUOTE 
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
  ----- Original Message ----- 
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black">From: 
  Michael 
  Ferguson 
  To: <A 
  href="mailto:realtraders@xxxxxxxxxxxxxxx"; 
  title=realtraders@xxxxxxxxxxxxxxx>realtraders@xxxxxxxxxxxxxxx 
  Sent: Thursday, July 19, 2001 8:46 
  AM
  Subject: [RT] tangent to AMA
  
  I have an ensign script for AMA that shows an 
  error that causes AMA to malfunction. Does someone know what the fix 
  is?
   
  Thanks
   
  procedure 
  AdaptiveAverage;var i,j,period: word; a,sum,amaq: 
  real;begin period:= 
  GetUser(eParm1); amaq:=GetUser(1,BarBegin-1);  for 
  i:=BarBegin to BarEnd do begin  if i<=period then 
  amaq:=Last(i)  else begin   
  a:=Abs(Last(i)-Last(i-period)); sum:=0;   for j:=i-period to i 
  do sum:=sum+Abs(Bar(eNet,j));   <FONT 
  color=#0000ff>a:=(a/sum*0.6022)+0.0645;  <FONT 
  color=#ff0000>THIS IS THE LINE THAT EW 
  FLAGS   
  amaq:=amaq+Power(a,2)*(Last(i)-amaq);     end;  
  SetUser(1,amaq,i); end;To unsubscribe from 
  this group, send an email 
  to:realtraders-unsubscribe@xxxxxxxxxxxxxxxYour 
  use of Yahoo! Groups is subject to the <A 
  href="http://docs.yahoo.com/info/terms/";>Yahoo! Terms of Service. 




To unsubscribe from this group, send an email to:
realtraders-unsubscribe@xxxxxxxxxxxxxxx





Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.