Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 449
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
How can I get the value of a field of a variable of structure type, knowing the sequence number of the field in that structure.
I know that field #1 (i.e. double) has changed value. How can I use the sequence number to find this field?
Or tell me how can I get the field of the structure knowing its string name?
here i have a value
string field="dval";
I want to query this particular structure field.
Or tell me, how can I get a structure field knowing its string name?
here i have a value
string field="dval";
I want to query this particular structure field.
Structures and, classes and interfaces
Structures and, classes and interfaces
Thanks, can you tell me where the answer to my question is in there?
Thanks, but can you tell me where the answer to my question is?
What's the problem, there are examples of assignment and getting value from structures.
You just need to convert double tostring. DoubleToString
What is the problem, there are examples of assignment and getting value from structures.
All you need to do is to convert double tostring. DoubleToString
What did you write and how does it solve my problem? I don't understand it.
And this was just an example. My structure has several fields of different types. And I don't know the field type, I only know the field name.
I have a string field name of the structure. I want, knowing this name, to request the corresponding field of the structure, i.e. get the value in this field.
you know, you're getting spoiled on the java.)
you need this.
https://www.mql5.com/ru/code/13663
What did you write and how does it solve my problem? It's not clear.
And that was just an example. My structure has several fields of different types. And I don't know the field type, I only know the field name.
I have a string field name of the structure. I want, knowing this name, to query the corresponding field of the structure, i.e. get the value in this field.
Look here, maybe this is what I need?
Forum on trading, automated trading systems and strategy testing
Can I define pyramid type programmatically ?
Anatoli Kazharski, 2015.06.17 17:07
Would you like to ask?
https://book.mql4.com/ru/build/conditions
The function calculates the trading criteria. The function returns the following values:
10- a trade criterion for opening a market Buy order has triggered;
20- trade criterion for opening a Sell order has triggered
11- trading criterion for closing a market Buy order triggered;
21- trading criterion for closing a Sell market order has triggered; 21 - market criterion for closing a Sell order has triggered;
return 10 20 11 21 возвращаемые значения
why is the program so locked into the return values?
Look here, maybe this is the right one.
And I have several fields of the same type. I don't think that's gonna help.
I found thishttps://www.mql5.com/ru/code/16282
I decided to pass its address (offset) in bytes instead of field name.
Would you like to ask?
https://book.mql4.com/ru/build/conditions
The function calculates the trading criteria. The function returns the following values:
10- a trade criterion for opening a market Buy order has triggered;
20- trade criterion for opening a Sell order has triggered
11- trading criterion for closing a market Buy order triggered;
21- trading criterion for closing a Sell market order has triggered; 21 - market criterion for closing a Sell order has triggered;
why is the program so locked into the return values?
This cycle is a multiple repetition. There is also a branching here. When the first condition triggers, operator return is executed and program execution stops. If the condition is false, the second condition is checked, and so on. If all 4 conditions are false, the following will be executed