PureBytes Links
Trading Reference Links
|
> This function is incredibly slow. Does anyone have any
> suggestions to speed it up?
Run it on fewer bars!
The only slow part in that function is the two loops that run
from 1 to Nbars. But you set Nbars to BarNumber. So if you have
5000 bars on your chart, you're calculating the correlation on
5000 bars. Do you really need the correlation of the ENTIRE
chart? If so, then you're stuck. It's a lot of work and it will
be slow. Maybe you could speed it up some by putting it into a
DLL.
But if you don't need the correlation of the ENTIRE chart, then
you could speed it up just by reducing the # of bars you use.
Gary
|