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
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