Here is how I managed to solve this problem, sorry if there are any errors but I have extrapolated from my code the part that was needed.
Code: Select all
//Part1
Variables:k(0), x(0);
Array : arr[500](0) ;
x=0;
//Array Population
for k = 0 to 400 begin
arr[k] = k;
end;
//Send Array to Globla Variable
For x=0 to 400 begin
GVSetNamedDouble("gv"+numtostr(x,0),arr[x]);
end;
Code: Select all
//Part2
Vars: var1(0),Close_count(Symbol_Length);
Arrays: arr[0](0); // Dynamic array
If (barstatus(1) = 2) then begin
// expand the array by one
array_setmaxindex(arr, close_count);
// get global variable and send to array
arr[Close_count] = GVGetNamedDouble("gv"+numtostr(Close_count,0),0);
// send array data to variabels
var1 = arr[Close_count];
Close_count = Close_count - 1 ;
end;