I'm sure this question has been addressed but I couldn't seem to find anything helpful searching the forum.
I am using the following order entry line of code
entryOrder = EnterLongLimit(NumStocks, Close[0] + 1 * TickSize, entrySignal);
I have found that the order fills on the next bar regardless of whether or not the price range of the next bar encompasses the limit price. For example if the current bar closes at $10.00 the limit price would be set at $10.01. If the following bar (where the order would be placed) gaps down to $10.00 at open and the bar range never goes higher than $10.00, then the buy order still fills at $10.01 and then closes out at the appropriate profit target. The problem is that during back testing this situation causes an error which results in no trades being entered after the above situation occurs.
Any advice?
Thanks in advance

Comment