Arrays

 

I don't have any code to show. But I'm trying to find a way to put mqlrates into another array.. such as high[] = {rates[].high}; doesn't work...but is there any way to make it work?

I see there's arraycopy or swap.. but I've looking for more examples on those

 
mmee55:

I don't have any code to show. But I'm trying to find a way to put mqlrates into another array.. such as high[] = {rates[].high}; doesn't work...but is there any way to make it work?

I see there's arraycopy or swap.. but I've looking for more examples on those

CopyRates is how it is usually done. if that does not fulfil your needs, then describe your desired result? Here's some practical examples on codebase.

This one is using CopyRates...https://www.mql5.com/en/code/26316

This one uses SymbolInfo...https://www.mql5.com/en/code/26330

A brief discussion on both...https://www.mql5.com/en/forum/319249

Bars and Rates Information Utility, displays how many bars there are in all timeframes for any user selected symbol, and shows the 'CopyRates' information availablity for any bar
Bars and Rates Information Utility, displays how many bars there are in all timeframes for any user selected symbol, and shows the 'CopyRates' information availablity for any bar
  • www.mql5.com
This utility is not a trading or market information utility. This will likely only interest those writing (or debugging) indicators using multiple timeframes and collecting information using Bars (or iBars) and CopyRates. The utility creates a list showing the number of Bars reported by the "Bars" function and shows the success of CopyRates for any selected bar by displaying that bar's time from the collected data (or, it shows the error).
 
Revo Trades #:

CopyRates is how it is usually done. if that does not fulfil your needs, then describe your desired result? Here's some practical examples on codebase.

This one is using CopyRates...https://www.mql5.com/en/code/26316

This one uses SymbolInfo...https://www.mql5.com/en/code/26330

A brief discussion on both...https://www.mql5.com/en/forum/319249

Or CopyHigh() if you just want high[].
 
mmee55: I don't have any code to show. … high[] = {rates[].high}; doesn't work...
  1. Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the file.
         How To Ask Questions The Smart Way. (2004)
              Be precise and informative about your problem

    We can't see your broken code.

  2. “Doesn't work” is meaningless — just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires — meaningless.
         How To Ask Questions The Smart Way. (2004)
              When asking about code
              Be precise and informative about your problem

  3. You have to copy each element., of course high[] = … "does not work" it doesn't even compile.

 
William Roeder #:
  1. Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the file.
         How To Ask Questions The Smart Way. (2004)
              Be precise and informative about your problem

    We can't see your broken code.

  2. “Doesn't work” is meaningless — just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires — meaningless.
         How To Ask Questions The Smart Way. (2004)
              When asking about code
              Be precise and informative about your problem

  3. You have to copy each element., of course high[] = … "does not work" it doesn't even compile.

To be fair it seems pretty obvious that the user doesn't know about CopyRates yet and therefore we can not expect to get a better problem description because the lack of basic knowledge is the main problem here.

That being said OP should use the search function for "CopyRates" in documentation.