Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 558
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
That's it, I've found my mistake. Some people need to voice their question in order to understand later how they got it wrong.
Unfortunately, apparently, I am one of those characters. (((
OrderSend
OrderSelect
I assume you mean byticket number?
Any pitfalls?
Greetings!
An order can be accessed using the OrderSelect command by its number.
Question, is it possible to know the numbers of existing orders in advance, so as not to go through them all? For example, we can memorize this number when opening a new order.
I understand that this number is assigned in order starting from 1. What are the possible nuances?
Thank you beforehand.
Is it possible to run in the code OnInit() in the loop OrdersTotal() and gather all of the information on open orders, in particular OrderTicket()?
When an order is automatically closed by TP or SP, is it possible to obtain the data of this order?
Is it possible to run the program in the OnInit() body and collect all the information on open orders, in particular OrderTicket(), in the OrdersTotal() loop?
When an order is closed automatically by TP or SP, is it possible to obtain the data of this order?
During BUY, SELL I save the required data into an array and then I roll this array and depending on the price I make the required changes (transfer SL to Breakeven, close order after the reverse, etc.), addressing to the required order via the ticket.
But I have orders with TP and SL which may close without my knowledge. I don't like the option of looking up the last closed order every tick and searching for it in my array to correct it.
"Orders may change over time, and the information collected on them during initialization will become outdated." I assume this is what is meant - closing the order?
The only option I see is to loop 2 loops in a tick, mine with orders andOrdersTotal() and I don't like it either.
"But more complicated than the usual enumeration, which is not done on every tick, but only as needed" Please share this algorithm.
Is it possible to run the program in the OnInit() body and collect all the information on open orders, in particular OrderTicket(), in the OrdersTotal() loop?
When an order is automatically closed by TP or SP, is it possible to obtain the data of this order?
And why do we need to convert all of this into a string? Is it a string type?
Is it possible to run the program in the OnInit() body and collect all the information on open orders, in particular OrderTicket(), in the OrdersTotal() loop?
When an order is automatically closed by TP or SP, is it possible to obtain the data of this order?
Why translate all this into a string? String type?