Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1255
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Can you tell me what the condition is, if the chart went down by even one point, then all orders were closed?
This way you can close all open trades (MQL4):
And if you want to selectively, you need to describe the selection condition.This way you can close all open trades (MQL4):
And if you want to selectively, you need to describe the selection condition.Thank you
2020.09.13 08:33:57.508 tst (EURUSD,H1) v1 = 1
2020.09.13 08:33:57.508 tst (EURUSD,H1) v2 = 1.01
2020.09.13 08:33:57.508 tst (EURUSD,H1) v3 = qwerty
2020.09.13 08:33:57.508 tst (EURUSD,H1) v4 = 3.1415
2020.09.13 08:33:57.508 tst (EURUSD,H1) v5 = 777
2020.09.13 08:33:57.508 tst (EURUSD,H1) v6 = 1
2020.09.13 08:33:57.508 tst (EURUSD,H1) v7 = 1.01
2020.09.13 08:33:57.508 tst (EURUSD,H1) v8 = qwerty
2020.09.13 08:33:57.508 tst (EURUSD,H1) v9 = 3.1415
2020.09.13 08:33:57.508 tst (EURUSD,H1) v10 = 777
2020.09.13 08:33:57.508 tst (EURUSD,H1) v11 = Value_11
Is it possible to make predefined variables in a template function so that it is not possible to specify everything when calling it? A simple assignment will still give an error if not all variables are specified.
Is it possible to make predefined variables in a template function
no,it can'T.
I can't explain how.... templates work it's roughly how - until such a function is called, the compiler knows nothing about its existence (often, there are even no compiler errors if there is no call)
then you call such a template function and the compiler fills the needed types and only then checks that everything will work properly
and then you make another call to the template with different types of parameters - and the compiler creates a new function, i.e. another one, i.e. as if you write 2 functions, which do the same thing, but with different types of parameters
whew, that's how it works ))))
UPD:
you can, but if the types in the template match, here's an example, it works correctly:
No,you can'T.
I can't explain how.... templates work it's like this - until you call such a function, the compiler knows nothing about its existence (often, there are even no compiler errors if there is no call)
then you call such a template function and the compiler fills the needed types and only then checks that everything will work properly
and then you make another call to the template with different types of parameters - and the compiler creates a new function, i.e. another one, i.e. as if you write 2 functions, which do the same thing, but with different types of parameters
Phew, so it goes ))))
And how do I know the type of input parameter?
If I pass a string type to a template and want to process it further.
The input parameters can be up to 64, any may have any type, how to determine that it is a string ?
How do I know the type of the input parameter?
If I pass a string type to a template and want to process it further.
There can be up to 64 input parameters and any of them can have any type, how can I know it is a string ?