I realize that the pending orders don't return the initial OrderOpenTime() and it returns the time when it opens the position (OP_BUY or OP_SELL).
I am doing a code that in each bar open an order (Sell or Buy) and in the max/min of the same candle put a pending order. I would like attach this 2 orders in some way to close it together.
Can someone help me on that?
Example:
Candle 1: Sell Order (ticket 1) & Buy Pending Order (ticket 2)
Candle 2: Buy Order (ticket 3) & Sell Pending Order (ticket 4). The Buy Pending Order (ticket 2) it's touched and enter into th market.
Candle 3: Sell Order (ticket 5) & Buy Pending Order (ticket 6).
.... the others pending orders (tickets 4 and 6) won't be executed.
In this example, I want attach in that way:
Candle 1: Tickets 1 and 2
Candle 2: Ticket 3 and 4
Candle 3: Ticket 5 and 6
I also think to assume that the even numbers are the market orders and the odd are the pendings, but....what happen if the spread/market can not put the order and this "system" will be uncounted?
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.
Hello,
I realize that the pending orders don't return the initial OrderOpenTime() and it returns the time when it opens the position (OP_BUY or OP_SELL).
I am doing a code that in each bar open an order (Sell or Buy) and in the max/min of the same candle put a pending order. I would like attach this 2 orders in some way to close it together.
Can someone help me on that?
Example:
Candle 1: Sell Order (ticket 1) & Buy Pending Order (ticket 2)
Candle 2: Buy Order (ticket 3) & Sell Pending Order (ticket 4). The Buy Pending Order (ticket 2) it's touched and enter into th market.
Candle 3: Sell Order (ticket 5) & Buy Pending Order (ticket 6).
.... the others pending orders (tickets 4 and 6) won't be executed.
In this example, I want attach in that way:
Candle 1: Tickets 1 and 2
Candle 2: Ticket 3 and 4
Candle 3: Ticket 5 and 6
I also think to assume that the even numbers are the market orders and the odd are the pendings, but....what happen if the spread/market can not put the order and this "system" will be uncounted?
Thank you in advance
Dream3r