How can I copy dynamic array to static?

 
double value_eUp[];
double value_eDown[]; 
 ArrayResize(value_eUp,500);
   ArrayResize(value_eDown,500);
   ArraySetAsSeries(value_eUp,true);
   ArraySetAsSeries(value_eDown,true);
int h = iCustom(_Symbol,_Period,"Indicator",Input1,Input2);
   for(int l=0; l<500; l++) {
        CopyBuffer(h,3,0,500,eUp);
         CopyBuffer(h],4,0,500,eDown);
            if(eUp[l]!=0 || eDown[l]!=0) {
               value_eUp[l] = NormalizeDouble(eUp[l],(int)SymbolInfoInteger(_Symbol,SYMBOL_DIGITS));
               value_eDown[l] = NormalizeDouble(eDown[l],(int)SymbolInfoInteger(_Symbol,SYMBOL_DIGITS));

               if(_Symbol=="AUDCAD") {
                  Print(value_eUp[l]);
               }
            }
         }

When I print the value_eUp[l] it prints dynamic values for 500 bars for e.g. 3001,3002,3003

but I want this to convert value_eUp[l]  into static array so it can be accessed as a global variable outside for loop

double value_up = {0.0}
double value_down = {0.0}

so it prints statically in a variable double 

How can i do that

 
Arpit T: t I want this to convert value_eUp[l]  into static array so it can be accessed as a global variable outside for loop

So do it. Move the array outside. All globally declared variables are static.

 
William Roeder #:

So do it. Move the array outside. All globally declared variables are static.

when I move, it does not print variable values and only print a single value

 
Arpit T #: when I move, it does not print variable values and only print a single value

Printing has nothing to do with moving the array. If you want to print multiple values, code it to do so.

This website uses cookies. Learn more about our Cookies Policy.