Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1489
![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
The information changes periodically.
For example, I want to see the position with the lowest opening price. Or to know the tick of the last closed position.
You can write everything in the print, but it is not convenient to look, you can miss. And so I can immediately see where I have errors.
Thank you very much for your help.
Now I have another task.
There is a function that counts the profit of all closed orders after a certain tick.
The time of order (position) closing has been added for checking.
Since everything was written in MQL4, and now it is being rewritten in MQL5, the question arose how to correctly and competently play this check.
Simply put, how to rewrite the code in MQL5)
Thank you all very much for your help.
Now another challenge.
There is a function that counts the profit of all closed orders after a certain tick.
The time of order (position) closing was added for checking.
Since everything was written in MQL4, and now it is being rewritten in MQL5, the question arose how to correctly and competently play this check.
Simply put, how to rewrite the code in MQL5)
Something like this.
Thank you all very much for your help.
Now another challenge.
There is a function that counts the profit of all closed orders after a certain tick.
The time of order (position) closing was added for checking.
Since everything was written in MQL4, and now it is being rewritten in MQL5, the question arose how to correctly and competently play this check.
Simply put, how to rewrite the code in MQL5)
Since it is not orders (previous post), but deals that will be searched, it is most convenient to use this code
Something like that.
I failed( Can you elaborate a bit more on the basis of my code.
I failed( Can you elaborate a bit more based on my code.
Perhaps it would be better to look at the variant by Aleksandr Slavskii. I have not worked with MQL4, and with hedging too.
Or pay attention here and, just in case, here.
Perhaps it would be better to look at the variant by Aleksandr Slavskii. I have not worked with MQL4, and I have not worked with hedging either.
Or pay attention here and, just in case, here.
No better. These are usual functions from fxsaber.
Your variant is quite acceptable, only you need to replace orders with transactions. Profit, commission and swap are stored by deals, not orders.
Alexey Viktorov #:
Your variant is quite acceptable, but you need to replace orders with transactions. Profit, commission and swap are stored by deals, not orders.
And take into account that an order can generate several deals.
So, either select deals for each order, or create an array/list (by the number of orders) of structures and fill them by selecting deals.