Arrays with high and low prices

 

Hi,

 for a symbol of the market watch list (symbol name is known) I need to get the arrays high[] and low[] that you typically get from the OnCalcualte() function:

  int OnCalculate (const int rates_total, // size of input time series

const int prev_calculated, // bars handled in previous call

const datetime& time[], // Time

const double& open[], // Open

const double& high[], // High

const double& low[], // Low

const double& close[], // Close

const long& tick_volume[], // Tick Volume

const long& volume[], // Real Volume

const int& spread[] // Spread

           ); 

Which functions return these arrays when OnCalculate cannot be used?

Thank you.

Chris 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants
Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants
  • www.mql5.com
Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants - Documentation on MQL5
 
zubr:
...
You did not look much : CopyLow. Do you need a link to CopyHigh too ?
 
angevoyageur:
You did not look much : CopyLow. Do you need a link to CopyHigh too ?
Maybe you can give me a hint how to look more efficiently. I looked up in the mql5 refences but there are so many functions that it's very difficult for a newbe to figure them out by oneself. Are there any other sources or structured documents where I can find the basics?
 
zubr:
Maybe you can give me a hint how to look more efficiently. I looked up in the mql5 refences but there are so many functions that it's very difficult for a newbe to figure them out by oneself. Are there any other sources or structured documents where I can find the basics?

Sorry you are probably right, the documentation is very complete ( but not perfect however) and abundant. An other approach for beginners is probably to read some articles, see this topic. Feel free to ask your questions.

Anyway if you do a search with the keyword "high low" you get some good links to documentation.

 
angevoyageur:

Sorry you are probably right, the documentation is very complete ( but not perfect however) and abundant. An other approach for beginners is probably to read some articles, see this topic. Feel free to ask your questions.

Anyway if you do a search with the keyword "high low" you get some good links to documentation.

Thank you, I will read some further articles to learn more about MQL5.

 

I have another question for which I have not found an answer yet.

 

I need an array whose size I know first at run time. Therefore, I am using a dynimic array. But I fail to initialise it:

double UpperBuffer[];

 int OnInit()

   {

  int dynSize = 20; // The value is actually computed by a function

   UpperBuffer[dynSize]=0; // Crash

    return(INIT_SUCCEEDED);

   } 

 

The program crashes at the second line of the code since probably there has been no space allocated for that array. How can I initialise this dynamic array to use it?

 
zubr:
...

I need an array whose size I know first at run time. Therefore, I am using a dynimic array. But I fail to initialise it:

...

The program crashes at the second line of the code since probably there has been no space allocated for that array. How can I initialise this dynamic array to use it?

ArrayResize.

Please edit your post and use the SRC button when you post code.

Reason: