Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1173
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
MQL5 iBarShift
According to mql5 documentation, the iBarShift function returns a value of int type.
int#
The int type has a size of 4 bytes (32 bits). The minimum value is -2 147 483 648, the maximum value is 2 147 483 647.
MyiBarShift does not want to give a value greater than 99999
I draw a trend line on the chart, the following script gets the start time of the line and outputs the bar number of that time.
When the line is shifted back in the history at some point the output value stops at 99999, and if
boolexact=false// mode
change it to true, it prints -1, and GetLastError = 0
What's wrong?
I tried different charts of different brokers, the time from the line is reading correctly, if I change PERIOD_M1 to M5, for example, then I need to move further in the history to reach 99999
MQL5 iBarShift
According to mql5 documentation, the iBarShift function returns a value of int type.
int#
The int type has a size of 4 bytes (32 bits). The minimum value is -2 147 483 648, the maximum value is 2 147 483 647.
MyiBarShift does not want to give a value greater than 99999
I draw a trend line on the chart, the following script gets the start time of the line and outputs the bar number of that time.
When the line is shifted back in the history at some point the output value stops at 99999, and if
boolexact=false// mode
change it to true, it prints -1, and GetLastError = 0
What's wrong?
I tried different charts of different brokers, the time from the line is reading correctly, if I change PERIOD_M1 to M5, for example, I need to move further in the history to reach 99999.
First of all check the maximum number of bars in the terminal settings.
First check the maximum number of bars in the terminal settings.
Thank you!
It was 10000, changed it to unlimited and it worked.
Not an obvious thing though...
Help in creating handles
Here's the thing
Question: From what parameters is the number (digits) of a handle assigned?
Can it be different after restarting the terminal?
Can it be different after a chart reinitialization?
In what cases can it change?
Help in creating handles
Here's the thing
Question: From what parameters is the number (digits) of a handle assigned?
Can it be different after restarting the terminal?
Can it be different after a chart reinitialization?
In what cases can it change?
If there is only one indicator, it always has a handle of 10. Each successive one is equal to the previous one+1 and it all depends on the order in which the handles were created. It can only change if one of the previous ones gets an error.
If you have one indicator, it always has a handle of 10. Each next one is equal to the previous one+1 and it all depends on the order in which the handles were created. It can only change if one of the previous ones gets an error.
I see, it's more or less understood. Thank you!
Help in creating handles
There's a thing like this
Question: From what parameters is the number (digits) of a handle assigned?
Can it be different after restarting the terminal?
Can it be different after a chart reinitialisation?
In what cases can it change?
Found answers
Please advise how to correctly pass a multidimensional array into a function.
If I simply specify MyFun( &Mas[][] ) in the header, the compiler generates an error on accessing an array element Mas[j][k] in the function body... But how?
There seems to be no problem with one-dimensional ones.
Please advise how to correctly pass a multidimensional array into a function.
If I simply specify MyFun( &Mas[][] ) in the header, the compiler generates an error on accessing an array element Mas[j][k] in the function body... But how?
There seems to be no problem with one-dimensional arrays.
The second and the next array's dimensions cannot be dynamic. Consequently, it must be MyFun(int &Mas[][7]) declared as an array, for example, int Mas[][7]; so it should be received.