'getting error "index 30 is out of bound, array size is 30" when I try to find unique values out of two arrays in pine script ( Trading View)?
I am trying to get unique values out of two arrays, I have coded a function to return the array containing unique values , following is the code I tried
disjoint(e,f)=>
c = e
d = f
for i=0 to array.size(e)-1
for j=0 to array.size(f)-1
if array.get(e,i) == array.get(f,j)
array.remove(c,i)
array.remove(d,i)
array.concat(c , d)
finala_array=disjoint(array1,array2)
I am passing two arrays (type float) and trying to return a array containing only unique values in pine script but I am getting the following error "index 30 is out of bound, array size is 30"
Need pine coders help in resolving this issue.
Thank you
Solution 1:[1]
If the size of the array is 30 the max index would be 29. Array starts at 0, 1,2,..., 29.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Robert Lartigue |
