When using sortIdx I run into the problem that this function apparently checks the lookback period and yields and error if the number of elements of the array you wish to sort exceeds the lookback period. However I do wish to sort an array that is not a time series and whose dimension is unrelated to lookback issues. This function should be in file functions.c as it is declared in function.h. Unfortunately function.c is not part of the distribution, otherwise it would be easy to just copy the code for sortIdx and remove checklookback command, which I assume is the problem. Anyone has a code snippet for sorting as sortIdx does? The standard qsort c++ function is different as it rearranges the elements of the original array which I don't want.