close[] when converting mql4 to mql5 ?

 

Just began to learn how to convert mql4 to mql5.

I learned how to deal with close[] in OnCalculate(......const double &close[], ......), with "ArraySetAsSeries()".

But in my own function "draw()", I also have to use close[], so I tried :

void draw(const double &close[])
{
   ArraySetAsSeries(close,true);
   ......
}

the compiling error of "close" fixed, but I got "draw - wrong parameters count" when calling draw().

I realised this is the wrong aproach, and I will have to use multiple constants, it's a pain to define and call like this. But what should I do, instead?

 
You have done nothing wrong in your use of "close".

 
You will need to pass the array close to the draw function.
 
Dominik Egert #:
You will need to pass the array close to the draw function.

Thanks! it works!