MqlRates Struct

 
Hello! Why would I need to use MqlRates struct? Instead of Rates.high(1)… to get the high of candle 1… I can Use iHigh()  or High[]… any reason for that? 
Thanks 
 
Daniel Cioca any reason for that?
Rude response, second rude response (on my Do Not Help list), posting decompiled code, and a false apology (DNH). Live in ignorance.
 
William Roeder #:
Rude response, second rude response (on my Do Not Help list), posting decompiled code, and a false apology (DNH). Live in ignorance.
Roeder
In my country we have a saying … “ if 10 people tell you that you are drunk, you should go to sleep. “ . Many people told you that you are rude sometimes … I was rude with you but that was a response to your comment… You don’t know me, I don’t know you… so we should respect each other… as many others told you, if you want to help/answer… do it… if feel that the question is that stupid and you feel offended, then move on… nobody is forcing you to answer stupid questions … why so much tension and anger… I am sorry, but almost every message of you is showing anger and tension… let’s take a break… relax… take a frozen yogurt … life is beautiful … people are generally good… even you… So I apologize again for my rood response that happened gozilian years ago, and I wish you all the best … P.S. so… how about that MqlRates… 
 
Daniel Cioca: Why would I need to use MqlRates struct? Instead of Rates.high(1)… to get the high of candle 1… I can Use iHigh()  or High[]… any reason for that?

Your question is nonsensical. One is a structure. It doesn't do anything or have anything. It is just a format for accessing data in an organised way. The other is a function, that does something and returns a value.

Instead, consider the question differently, for example ... why use CopyRates() instead of iHigh(), iLow(), etc.?

If you ask it that way, then it starts to make more sense. CopyRates returns data in an array of MqlRates, while iHigh, iLow only returns a single value.

CopyRates is more efficient for processing large amounts of data, while iHigh, iLow is simpler for singular values and sporadic use.

Does that answer your question?

 
William Roeder #:
Rude response, second rude response (on my Do Not Help list), posting decompiled code, and a false apology (DNH). Live in ignorance.

i don't think he'll beat your high score though  😇 😂

 
@Lorentzos Roussos #: i don't think he'll beat your high score though  😇 😂

Your post is uncalled and off-topic. @Daniel Cioca has tried in his own way, in post #2, to apologise and lessen the animosity between the two. Please don't stir things up again.

 
Fernando Carreiro #:

Your post is uncalled and off-topic. @Daniel Cioca has tried in his own way, in post #2, to apologise and lessen the animosity between the two. Please don't stir things up again.

its humor . humor calms tensions . like this : 


 
Fernando #

Does that answer your question?

Not really ..😁… yes , my question was a little dodgy… but you understood what I meant… 
Why is it better or more “efficient “ using CopyRates() ? If I need the high of candle1, why is it better to take it from an array of MqlRates instead of calling iHigh(), or High[1] ?  I mean the only reason I can think is that might be using less resources to acces the data? But also, storing that data into an array, you need memory, while if acces when needed via available functions, you don’t need to store anything … thanks ! 
 
Daniel Cioca #: Why is it better or more “efficient “ using CopyRates() ?

Please read my answer again carefully ... "CopyRates is more efficient for processing large amounts of data, while iHigh, iLow is simpler for singular values and sporadic use."

Daniel Cioca #: If I need the high of candle1, why is it better to take it from an array of MqlRates instead of calling iHigh(), or High[1] ?

Did I say it is better to use CopyRates instead of iHigh() or High[1] to just get a a "single" value?

Also, please remember that CopyRates was introduced into MQL4+, so as to be compatible with MQL5.

On MQL4 using the build in arrays High[i] is much easier and quicker, but that does not exist in MQL5.

In fact, on MQL4+ only (not MQL5) there is also ArrayCopyRates which yet another way of reading the data.

So, "which is better" depends on your needs and on which platform (MQL4 or MQL5) you are working.

 
Fernando Carreiro #:

On MQL4 using the build in arrays High[i] is much easier and quicker, but that does not exist in MQL5.

Ok...now I understand..Thank you!

 
Daniel Cioca #: Ok...now I understand..Thank you!
You are welcome!
Reason: