DomGilberto: I am wanting a way that when I select externally the order ticket number, in that code above, it will use that ticket number within the function and close just that ticket number? Hope that makes sense?
1. If you place orders manually then you do not have the order ticket , nor can you assign a magic number. Therefore you need a code that will get the order ticket(s) and then you can map the ordinal number (this is what you select) to the order ticket to close the order.
2. And if you place orders through code (i.e. OrderSend()) then you have the order ticket and you could store it in a simple array at position corresponding to the number of the order (its ordinal number, i.e. 1 .. 4) and therefore retrieve it later on by position (ordinal number = what you select), to close the order.
In example:
You entered 4 pending orders manually.
Then your code has to scan the order queue and get the order tickets into an array of a capacity of 4, in the right order.
Then, when you later on select an order number (its ordinal number 1 .. 4) for closure, your code simply looks up the order's ticket at that position form the array and closes the order.
Here a (incomplete) code sample how this could look like:
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.
For me it is really hard to understand what you want.
You only have 2 options:
and
I am wanting a way that when I select externally the order ticket number, in that code above, it will use that ticket number within the function and close just that ticket number? Hope that makes sense?
1. If you place orders manually then you do not have the order ticket , nor can you assign a magic number. Therefore you need a code that will get the order ticket(s) and then you can map the ordinal number (this is what you select) to the order ticket to close the order.
2. And if you place orders through code (i.e. OrderSend()) then you have the order ticket and you could store it in a simple array at position corresponding to the number of the order (its ordinal number, i.e. 1 .. 4) and therefore retrieve it later on by position (ordinal number = what you select), to close the order.
In example:
You entered 4 pending orders manually.
Then your code has to scan the order queue and get the order tickets into an array of a capacity of 4, in the right order.
Then, when you later on select an order number (its ordinal number 1 .. 4) for closure, your code simply looks up the order's ticket at that position form the array and closes the order.
Here a (incomplete) code sample how this could look like: