PureBytes Links
Trading Reference Links
|
Hi Christian,
The loop is in SortArray. That is where the error probably comes from.
You can try putting
[InfiniteLoopDetect = FALSE]
in the function by creating a new function SortLargeArray and see if it
works for you. Please do include Bob's concepts of efficiency in the
indicator. And if you are working with very large arrays, consider an
even greater step size for increasing the array size.
Still, sorting an array of size is a very CPU-intensive operation, with
total CPU time increases with (arraySize*arraySize). Consider, for
example, @NQ 3 min chart over 1 year. With 23.75 hr/day, 250 days/year
(estimate), you have 118,750 bars, and need an arraySize of that number.
In addition, the function SortArray (as it is) uses a sorting
algorithm that is inefficient for sorting large arrays.
What are the key numbers that you try to get out of the array? Are
there more efficient and faster computation methods to get what you need?
Harrison Cai
|