MqlRates rate; start_pos=Bars-1; // QUESTION:WHAT STAR_POS MEAN? rate.open=Open[start_pos]; WHAT RATE.OPEN MEAN?
- Starting position. Operate on the oldest bar to the newest. just like any indicator's compute loop.
- rate.open is the open variable name in the rate structure. History Data Structure - Data Structures - Standard Constants, Enumerations and Structures - MQL4 Reference
if you search for rate.open in entire documentation, you cant find anything, so what it this, a variable? if it's a variable, its an int, data, double, what this is? your link doesnt explain
what rate. means, could you explain me more about it and what it does?
- Rate is a variable, so of course your not going to find rate.open any more than your going to find any other variable name used in code. It's type is MqlRates; I gave you the link to it's definition.
- The structure contains multiple elements one of which is a double called open.
- To access the element open of the variable rate you use the dot notation (rate.dot).
- Learn what a structure is. Google it. Same in MQ4/5, C, C++, Java, Ada, etc.
MqlRates Equivalent but with no data typing struct MqlRates{ datetime time; double open; double high; double low; double close; long tick_volume; int spread; long real_volume; }; MqlRates rate; PrintFormat("open=%g", rate.open);
#define MRtime 0 #define MRopen 1 #define MRhigh 2 #define MRlow 3 #define MRclose 4 #define MRnTick 5 #define MRsprd 6 #define MRlots 7 #define MRCOUNT 8 double rate[MRCOUNT]; PrintFormat("open=%g", rate[MRopen]);
structure is not described on mql4 book, so as in documentation they don't explain it the way they should, but metatrader
still is the best despite that, i'll look into structure meaning, thanks a lot for the advice
structure is not described on mql4 book, so as in documentation they don't explain it the way they should, but metatrader
still is the best despite that, i'll look into structure meaning, thanks a lot for the advice
- Rate is a variable, so of course your not going to find rate.open any more than your going to find any other variable name used in code. It's type is MqlRates; I gave you the link to it's definition.
- The structure contains multiple elements one of which is a double called open.
- To access the element open of the variable rate you use the dot notation (rate.dot).
- Learn what a structure is. Google it. Same in MQ4/5, C, C++, Java, Ada, etc.
MqlRates Equivalent but with no data typing
A different way to think about a struct is to remember back to when the old-timers (pre-build-600) used to make two-dimensional arrays to store OHLC.
So instead of this:
double rates[][4]; ArrayResize(...); rates[i][0] = Open[i]; rates[i][1] = High[i]; ...
Now you use an array of structs:
MqlRates rates[]; ArrayResize(...); rates[i].open = Open[i]; rates[i].high = High[i]; ...
structure is not described on mql4 book, so as in documentation they don't explain it the way they should, but metatrader
still is the best despite that, i'll look into structure meaning, thanks a lot for the advice
Here is one of the best and easiest to understand descriptions of a struct... http://www.learncpp.com/cpp-tutorial/47-structs/
yes but mql4 book is great, because documentation makes a lot of assumptions about your previous knowledge, if you never coded i think its really hard
to lear only by metaquotes pages, the book is a game changer for non programmers, they should care more about make things clear
Here is one of the best and easiest to understand descriptions of a struct... http://www.learncpp.com/cpp-tutorial/47-structs/
thanks, for the link, i'll look into that
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
There are variables, like start_pos, but they on the code are not previousily related to the data type, so they are not int or double, or a function, i don't know what it is, and if
i seach i found nothing about these words, so what's thedeal about them?