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

RE: Function



PureBytes Links

Trading Reference Links

> I like the idea of placing more emphasis on
> recent equity changes, but damn it's slow.

Then, as I said, run it on fewer bars.  That will place more 
(all) emphasis on recent data, and speed it up too.  Ideally 
you'd like to only run it on the last N bars of an arbitrary-
length chart, but that's difficult given the way it sums up stuff 
on every bar.

You also have to worry about numeric precision when you sum up a 
lot of data.  Running this on too many bars is likely to give you 
bogus answers because the various Sum values get large enough 
that the amount you add on each bar gets lost in TS's 7-digit 
precision.  (Unless you're running on TS8, which supports double 
precision numbers.)  So that's another good reason not to run it 
on a lot of bars.

Possible solutions:

* Run it on a chart with fewer bars.
* Add a "StartDate" parameter, and don't start counting bars and 
summing up stuff until you pass that date.

Gary