Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 785

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
Is it necessary to writetempl(T1) in front of each functionand it will take a variable or the required argument? Why istempl(T) declaredandtempl(T1) called, should I add a number before each function(templ(T1)templ(T2)templ(T3)) or should I writetempl(T1) everywhere?And if several parameters are scored intemplate<typename T>then how would it be, like thistemplate<typename T,typename P,typename Q>-templ(T,P,Q).
Yes, the record is still done before each function, where you want to turn a normal function into a function template. It's just this record is noticeably shorter now.
T1 is a name that denotes some type of data, which is stored in a variable with its name (a). It is not necessary to add a number. You can use the same name everywhere, even the same T without a number.
The templ is not called, but is automatically replaced with what is prepended to it in #define. This is a simple replacement of one text with another, but you can write the input parameters in brackets, just like functions.
At compile time templ(T1) expression will be replaced with template<typename T1> and you will get this
For multiple parameters, yes, you guessed correctly how to describe.
I see, thank you for the information, I've already tried it out - it's handy.
I understand that you need to select via switch, and enter the names there
Your code prints an int value, while you need to select a string
I would use an array of string constants to select the indicator name, i.e. my example gives you the number of the record when the user selects it, and this number can be the number of an element (index) of the string array, where you would store the text names of indicators
sorry i don't have a terminal, i can't show the example in the code, but i think i've explained the idea
PS:
I would use an array of string constants to select the name of the indicator, i.e. my example gives you the number of the record when selected by the user, and this number can be the number of the element (index) of the string array where you will save the text names of the indicators
sorry i don't have a terminal, i can't show the example in the code, but i think i've explained the idea
PS:
Thanks, I did, it's quite handy.
And the final version, this is just the bomb. I've been missing this for a long time, as I have at least 20 charts open in the terminal
Hi all. Help, please. I want the EA to wait for n hours after closing a trade. Can I also tweak this function. Would it be correct to change Mode_Trades to Mode_History? Thank you
MODE_HISTORY - of course it is needed, but there is another point: in the text "after closing" and in the codeOrderOpenTime
And don't go to bars, return time t and then use it somehow:
MODE_HISTORY - of course it is needed, but there is another point: in the text "after closing" and in the codeOrderOpenTime
And don't go to bars, return time t and then use it somehow:
I corrected to Mode_History, that's how the owl doesn't open the first order. Can you elaborate on the solution? Thanks
I corrected to Mode_History, so the owl doesn't open the first order. Can you please elaborate on the solution? Thanks
Take a look at this.
Take a look at this.
How does the first order get resolved?
And how do you resolve the first order?
Please note, the function has changed slightly.