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
@ Simon:
"your issue that you started with was "invalid index buffer number in iCustom function""
I am aware that I can give-
-a shift of 0,1,2,3, or even 20!
The problem which I currently have is this...
Lets just say that I write "int maPeriod_1" with a shift of zero (0) inside my expert advisor.
NOW, I wish to write an additional "int maPeriod_1" with a shift of one (1) inside my expert advisor.
How can I write "int maPeriod_1" with a shift of one (1), when I have already declared "int maPeriod_1" with a shift of zero (0)?
Thank u.
The problem which I currently have is this...
Lets just say that I write "int maPeriod_1" with a shift of zero (0) inside my expert advisor.
NOW, I wish to write an additional "int maPeriod_1" with a shift of one (1) inside my expert advisor.
How can I write "int maPeriod_1" with a shift of one (1), when I have already declared "int maPeriod_1" with a shift of zero (0)?
Thank u.
OK,
I would do it like this, it avoids confusion IMO . . .
@ Simon:
I now understand how to declare "maPeriod_1"-
- but how can I distinguish the two, when using either shift 0 or shift 1 of "maPeriod_1", in lower blocks of code? Both "maPeriod_1" of shift 0 and shift 1 have the same name, "maPeriod_1".
Thank you.
@ Simon:
I now understand how to declare "maPeriod_1"-
- but how can I distinguish the two, when using either shift 0 or shift 1 of "maPeriod_1", in lower blocks of code? Both "maPeriod_1" of shift 0 and shift 1 have the same name, "maPeriod_1".
Thank you.
Use a different variable name . . . . perhaps maPeriod_1_0 and maPeriod_1_1 ?
@ Simon:
Thank you.
@ Simon:
Thank you.
I think you need to re-read the Book especially the section about variables . . .
@ Simon:
Understood, I will read the book.
Thank you!
Hello MQL4 community,
There are two types of "return();" operators.
Type 1. ("return operator") terminates the current function execution and returns the control to the calling program.
Type 1. example: "return;".
Type 2. ("return(expression); operator") terminates the current function execution with "result transmission".
Type 2. example: "return(x+y);".
1. Once "return;" has been executed, where is the "calling program" location that the control is given to? (Referring to "Type 1.")
2. What is "result transmission"? (Referring to "Type 2.")
3. What is the purpose of "void"? (please provide simple example)
Thank you.
Hello MQL4 community,
There are two types of "return();" operators.
Type 1. ("return operator") terminates the current function execution and returns the control to the calling program.
Type 1. example: "return;".
Type 2. ("return(expression); operator") terminates the current function execution with "result transmission".
Type 2. example: "return(x+y);".
1. Once "return;" has been executed, where is the "calling program" location that the control is given to? (Referring to "Type 1.")
2. What is "result transmission"? (Referring to "Type 2.")
3. What is the purpose of "void"? (please provide simple example)
Thank you.
There is one type of return operator . . . return; returns no value but passes control back to where the function was called from, return(x); returns x and passes control back to where the function was called from.
3. All functions have a type, the type refers to the type of variable returned from the function. If a function returns no variable then it is returning type void . . or nothing.
2. I don't know where you have seen "result transmission" so i don't know it's context, I guess it means the returning of the returned value.
1. If a function was called from start() when the function finishes with the return control passes back to the start() function to the point just after the function was called.