View Single Post
  #3  
Old 04-18-2002, 02:46 PM
Guest
 
Posts: n/a
Default whoops, I forgot the less-than/greater-than thing



My opinion is that exponentials decline far too quickly. Meaning, the price 2 days ago has almost no weight compared to the price today.


Average = 0; Days = 0;

While Days (is less than) 10 begin


Average = Average + price(Today - Days)/(Days + 1);


Days = Days + 1;

end;


In this example*, the price two days ago would have only 1/3 the weight of the price today. Now suppose we substituted


Average = Average + price(Today - Days)*(10-Days);


The price 2 days ago would have 8/10 the weight of the price today. For whatever reason - and there is a hypothetical reason which I won't drudge up right now - this seems to work better for most purposes.


eLROY


*This code will not produce any useful result in any interpreter, compiler, or API I know of It might not even be right. But writing this warning was easier than making this warning unnecessary.


Reply With Quote