Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1260
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
I don't understand, how can I track the moment a position is closed, other than by querying the state of the position on every tick? Of course, not all positions are queried, but there is still a query on every tick.
Study the documentation carefully.
It is not checked on every tick. If there is a signal, it starts checking and opens a deal. That's all :)
In mql4, for lack of a cook *** the janitor. The question was about mql5
Study the documentation carefully.
Thank you. If the order is replaced by an order it is easier to understand. I didn't see that the execution of an order-order is a deal. All in all, it's complicatedly written and implemented.))
You'd better try to accept the terminology you have and not substitute your own. You will get used to it in time, and you will understand it depending on the language you are using. On the contrary, in MT4, a market order is better to be called a position. That's the way many people understand it.
You'd better try to accept the terminology as it is, rather than substituting your own. Over time you will get used to it and you will understand it depending on which language you are talking about. Even vice versa, in MT4 a market order is better referred to as a position. That's the way many people understand it.
how to initialise such a structure?
how to initialise such a structure?
how to initialize such a structure?
no way ( only each field of the structure one by one )
you need to set the size of the arrays, you could write a constructor for that, but there will be a problem - the syntax won't allow you to create an array of structures with a constructor
solution - use a class instead of the structure and use pointers, you can initialize the arrays sizes in the class constructor, and the data can be copied into them
4 to 5. I don't know the syntax. It should be in the 2-dimensional array by logic.
2020.09.23 08:27:09.554 tst (EURUSD,H1) [a] [b]
2020.09.23 08:27:09.554 tst (EURUSD,H1) [0] 1 1.10000
2020.09.23 08:27:09.554 tst (EURUSD,H1) [1] 9 9.90000
how to initialise such a structure?
Data rates[5]= {0.0,0.0,0.0,0.0}; //ошибка
Initialise and nullify are different concepts. If zeroing, judging from your attempts, is like this
ZeroMemory(rates);
no way ( only each field of the structure one by one )
you need to set the size of arrays, you can write a constructor for this, but there will be a problem - the syntax will not allow to create an array of structures with the constructor
solution - use class instead of structure and use pointers, then you can in the class constructor initialize the arrays sizes, and the data can be copied into them
2020.09.23 08:27:09.554 tst (EURUSD,H1) [a] [b]
2020.09.23 08:27:09.554 tst (EURUSD,H1) [0] 1 1.10000
2020.09.23 08:27:09.554 tst (EURUSD,H1) [1] 9 9.90000