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.
The information does not change every tick? Nikolay also suggested that you can simply make the output after some timeout, thus reducing the frequency of this output.
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.
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)
// сначала выбираем нужный интервалHistorySelect(TimeStart,TimeCurrent()+10);
// перебираем ордера в интервалеfor(i=HistoryOrdersTotal()-1;i>=0;i--)
{
ord=HistoryOrderGetTicket(i);
// далее получаем (или сразу сравниваем) любые свойства ордера, типа
o_sym=HistoryOrderGetString(ord, ORDER_SYMBOL);
o_magic=HistoryOrderGetInteger(ord, ORDER_MAGIC);
...
}
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
HistoryPositionsTotal Возвращает количество всех закрытых позиций в истории. HistorySelect() не влияет на результат данной функции. int HistoryPositionsTotal(); Возвращаемое значение Значение типа
Hello, I have a problem with the VPS. I don't get notifications on my phone when the MT4 is off. When the platform is on, notifications work. Can someone please give me some advice on what could be wrong? Thank you
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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.