Currently the strategy (at random times), does the following at bar close
1. [ENTRY] Place a Market Stop sell order at the current bar low - 1 tick
2. Remember the current bar high
3. [ACTIVATION] once this order from (1) gets a fill, check the level of the Close[0] vs entry_bar_high+3ticks.
3.a. if that level is higher than the market, place a stop market buy order at the entry bar's high + 3 ticks
3.b. if not, then do a market order
however, what I am seeing is that sometimes (in about 10 cases over 2000 orders), the orders from (3a) get ignored. In some instances the stop price as determined by entrybarhigh+3ticks is sometimes very close to the Close so first I thought that might be why. But if I focus on this 1 example and don't allow execution of any of the previous orders, then the orders go through just fine.
The granularity i am using is 1min bars.
So my questions are
* What exactly are the rules to determine an order, in the unmanaged setting, gets ignored? I assume the stop price has to be well above the close. But how much is well enough?
* Is there a way to list all the outstanding working orders? That way I can cross check if there are maybe other orders (buy or sell) with the same stop price
* if I take the returned object from SubmitOrderUnmanaged, it always seems to be null when those orders are ignored. Is that the best programmatic way to check if an order is ignored? Are there possible scenarios where this returns null but the order has gone through?
* Is the behaviour rhe same in backtest as in real time?
Looking forward to your responses
Comment