[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 610

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
what is the calculation ahead of a=5 or a=10 ?
Well the programme is run from top to bottom) First 5, then 10.
When parameters are passed to a function by reference, it is the variables that are passed to the function that are changed.
Suppose you need to return more than one parameter from a function. Pass them to the function by reference. The variables that are set outside the function - the variables you passed into it by reference - will be changed in the function.
If you have three variables e, f and g, if the appersand in the function description before the variable name in its parameters, the variables will be changed that you put in the parameters when calling the function.
int func (int a , int &b , int &c ) {
}
When calling a function:
int e=40 , f=50, g=60;
int d=func (e, f, g);
d will be equal to 10 (the function will return modified e)
f will be equal to 20
g will be equal to 30
f and g are passed here by reference
When parameters are passed to a function by reference, it is the variables that are passed to the function that are changed.
Suppose you need to return more than one parameter from a function. Pass them to the function by reference. The variables that are set outside the function - the variables you passed into it by reference - will be changed in the function.
If you have three variables e, f and g, if the appersand in the function description before the variable name in its parameters, the variables will be changed that you put in the parameters when calling the function.
int func (int a , int &b , int &c ) {
}
When calling a function:
int e=40 , f=50, g=60;
int d=func (e, f, g);
d will be equal to 10 (the function will return the modified e)
f will be equal to 20
g will be equal to 30
f and g have been passed by reference here
Look carefully in the DOCU - there is EVERYTHING, you just need to be able to readhttps://docs.mql4.com/ru/basis/variables/formal
Look carefully at the DOCU - There is EVERYTHING there, you just need to be able to readhttps://docs.mql4.com/ru/basis/variables/formal
It is possible to pass parameters by reference. In this case, modification of such parameters will affect the corresponding variables in the called function passed by reference. You cannot pass elements of arrays by reference. Parameters can be passed by reference only within the limits of a single module, such an opportunity is not provided for library functions. In order to specify that a parameter is passed by reference, the & modifier must be placed after the data type.
Example:
Arrays can also be passed by reference, all changes will be reflected in the original array. Unlike simple parameters, arrays can be passed by reference in library functions as well.
Parameters passed by reference cannot be initialised with default values.
Good evening. I am trying to understand the bars. I want to write a script to analyse the daily bars. I am trying to analyze the history of the bars and the percentage of their occurrence. I want to collect statistics not only for the entire history but for a selected timeframe as well. I tried to search for a script but there are too many of them. I would like to ask for a link to such a script or give advice on how to deal with bars, as I have no experience.