I and testing different execution orders in my strategy from market orders to limit orders. An example of the code for long orders for market and limit order are below.
Limit Order
EnterLongLimit((int)numContracts, GetCurrentBid(), "PRLong");
Market Order
EnterLong((int)numContracts,"PRLong");
The code is exactly the same except for the order types and data on which the strategies are running on are also exactly the same. Hence,the time at which the strategy triggers the order for both should be the same and I would expect the limit order to go through as long as the bar breaches above (for shorts) and below (for longs) the limit price. But the end-result is not what I was expecting.
I have attached a snapshot of the chart here. The "limit order" strategy missed out on a short trade which was executed by the "market order" strategy at 03:27 AM SGT. Prices have run up thereafter for the next 2 minutes so a short limit order should have been filled isn't it?
I am baffled by this results. Does anyone encounter the same issue?
Comment