How i have tranformed an array into a numseries variable

Questions about MultiCharts and user contributed studies.
Alege75
Posts: 3
Joined: 05 Apr 2021
Been thanked: 2 times

How i have tranformed an array into a numseries variable

Postby Alege75 » 05 Apr 2021

Hi, I've been trying for a long time to turn an array into a variable so that I can easily apply applicable functions to numseries variables.
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;

Return to “MultiCharts”