Disliked{quote} Why changing the IMA() call? Call to IMA() is by far the fastest way to get the price if the basic set of prices is to be used (test it, and you shall see)Ignored
valuesc[i] = iMA(NULL,0,1,0,MODE_SMA,Pricec,i);
followed by (equivalent)
worksTemp[k] = ( valuesc[k] - valuesc[[j])/(j-k);
cannot be faster than (again, equivalent) the replacement:
worksTemp[k] = ( Close[k] - Close[j])/(j-k);
as the 'Close' array is maintained by the environment regardless.
and, I'm pretty sure
Close[i] == iMA(NULL,0,1,0,MODE_SMA,Pricec,i);