Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1051
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
Thanks for the reply, I've looked at both the documentation and your example, but still haven't found how to get a parameter similar to OrderClosePrice() in MT4.
If ENUM_DEAL_ENTRY ==DEAL_ENTRY_OUT && ENUM_DEAL_TYPE == DEAL_TYPE_SELL --- it means that BUY position was closed and therefore DEAL_PRICE is the closing price.
Thanks for the reply, I've looked at both the documentation and your example, but still haven't found how to get a parameter similar to OrderClosePrice() in MT4.
There is no direct analogy. The position consists of trades. If you want accurate data exactly for a position - you must first assemble the position back from the trading history.
Therefore, it is better to work with the concept of "deal".
Generally, the implementation depends very much on the answer to the question: "Why?". That is, first describe exactly what you want and why.
How do I get the closing price of an order (trade, position - anything at all)?
Googled the forum, couldn't find it.
https://www.mql5.com/ru/forum/162461
alternatively openhttps://www.mql5.com/ru/code/16006
and look at@fxsaber' s implementation
It's unrealistic to rip out the implementation from there, as it has a strong dependency on all other parts of the library.
Friends, please advise how to solve a seemingly simple problem. A piece of code:
Compiler warning:
declaration of 'stavkariska' hides local declaration at line 25 script.mq5 32 12
possible use of uninitialized variable 'stavkariska' script.mq5 33 39
What is the right way to solve this problem, so that it compiles without any warnings?
Friends, please advise on how to solve a seemingly simple problem. A piece of code:
Compiler warning:
declaration of 'stavkariska' hides local declaration at line 25 script.mq5 32 12
possible use of uninitialized variable 'stavkariska' script.mq5 33 39
How to solve the problem correctly, so that it compiles without any warnings?
Use a translator:
That is, declare variables more carefully - avoid declaring the same variables in the same scope.
When declaring a variable , make a habit of initializing it immediately.
Make use of the translator:
That is, declare variables more carefully - avoid declaring the same variables in the same scope.
When declaring a variable , make a habit of initialising it immediately.
The thing is that declaring another variable in the If else operator, I get the need to declare it again, otherwise the error "'stavkariska1' - undeclared identifier. A vicious circle for a beginner. Perhaps there are other ways to implement the selection?
The little robot made a mistake in a hurry, too.
The highlighted one is unnecessary. Without re-declaration it should work as it should.
The little robot made a mistake in his haste too.
The highlighted one is redundant. Without the re-announcement, it should work as it should.
Thank you for your attention. I'm sorry, I typed directly into my browser using copypaste.
The little crabber also made a mistake in his haste.
The highlighted one is redundant. Without a re-announcement it should work as it should.