[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 199

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
Define a foreground chart colour, write an intercept handler, and repaint.
Is that clear?
The point is clear. I don't know what function to use to pull the parameter. Okay, thank you.
I'll try poking around in the guts of something like zup, where the text
about patterns inherits the text colour of the window colour scheme.
In one indicator I came across the following construction:
int R; //variable is declared on the global level
I found the same variable with the & symbol in a user-defined function like this
void Function(int A, int B, int &R) {R = A*B}
Can anyone tell me why this is done and where I can read about it in detail?
In one indicator I came across the following construction:
int R; //variable is declared on the global level
I found the same variable with the & symbol in a user-defined function like this
void Function(int A, int B, int &R) {R = A*B}
Can anyone tell me why this is done and where I can read more about it?
The tutorial is here, and google rules!
Tutorial here and google rules!
I don't understand what would change if it were like this:
void Function(int A, int B) {R = A*B}
The R variable is declared globally and will be visible within the function anyway. In what cases is it necessary to pass parameters by reference?
I don't understand what would change if it were like this:
void Function(int A, int B) {R = A*B}
The R variable is declared globally and will be visible within the function anyway. In what cases is it necessary to pass parameters by reference?
Read the textbook, the documentation, google it, here.
"When calling the swap function, new variables a and b are created and assigned values 3 and 5. These variables are in no way related to the variables p and q and changing them does not change the values of p and q. This method of parameter passing is called value passing.
In order for a function to be able to change the values of the variables declared in other functions, you must specify that the parameter being passed is not just a constant value but a variable, you must pass the values by reference. To do this, the swap function should have been declared as follows:
void swap(int & a, int & b)
The ampersands before the variable name mean that this variable is not a local variable, but a reference to the variable specified as a parameter when the function is called. Now, when you call swap(p,q), variables a and b are synonymous with variables p and q, and changing their values causes the values of p and q to change. But you cannot call a function as swap(3,5) because 3 and 5 are constants, and you cannot make variables synonymous with constants".
Read the tutorial, documentation, google, here.
"When the swap function is called, new variables a and b are created and the values 3 and 5 are assigned to them. These variables are in no way related to the p and q variables, and changing them does not change the values of p and q. This method of parameter passing is called value passing.
In order for a function to be able to change the values of the variables declared in other functions, it is necessary to specify that the passed parameter is not just a constant value but a variable, you must pass the values by reference. To do this, the swap function should have been declared as follows:
void swap(int & a, int & b)
The ampersands before the variable name mean that this variable is not a local variable, but a reference to the variable specified as a parameter when the function is called. Now, when you call swap(p,q), variables a and b are synonymous with variables p and q, and changing their values causes the values of p and q to change. But you cannot call a function as swap(3,5) since 3 and 5 are constants and you cannot make variables synonymous with constants".
Thanks for the information
You can, but you need to get the EA up to speed
Yes, I understand that :) It's just that you often try some strategy, a tester version, just to see how the idea works out. Sometimes errors there reveal themselves in a completely different light. And you don't have time to waste, if you need to compose and see it in a hurry.
Is there any way to bluntly close it, so that it does not copy what he writes to the log file? Question about it.
That's understandable:) It's just that often you just try a strategy, a tester version, just to see how the idea works out. Sometimes the mistakes come out in a completely different light. And you don't have time to waste, if you need to compose and see it in a hurry.
Is there any way to bluntly close it, so that it does not copy what he writes to the log file? Question about it.
How can you trust an EA that works in error
It needs something else - to change the program's internal variable, the reference point for drawing the indicator, and then to re-calculate and redraw the line after the key combination is pressed.
Why doesn't MT want hooks, by the way?
Thank you for understanding!):