I am trying to create a trading algo that uses daily frequency data and limit style (buy) order execution. Trade signals are generated daily after the current day close and limit buy orders are placed before the next day open.
The problem that I am running into with the backtest is that limit orders will not trigger unless the limit price is set to be above the close price of the next daily bar. If the order trigger condition (limit buy price > next day close price) is met, the price at which the order fills (assuming no slippage) is the next daily bar close price.
What I expected to happen (and what happens in the real world) is that a limit buy order, placed before the open, will trigger and get filled at the open price (if the open price is below the limit price) or at the limit price (if the limit price is between the low price and the open price) or not at all (if the limit price is below the low price).
Is there a way to alter the limit buy order trigger condition to be something other than (limit buy price > next close price)? Could this problem be solved with a custom slippage model - or would that just pertain to the order fill price and not the order trigger condition?
I am familiar with using custom slippage models to alter the fill price for market style orders. The default market order trigger is the close of the next bar and the default order fill price (assuming no slippage) is the close price of the next bar. By way of example, with custom slippage, the order trigger (when the order is filled) can't be changed (as far as I know), but the fill price could be set to the close price of the current daily bar (to simulate market on close orders) or to the open price of the next daily bar (to simulate trade at the next open orders).
I know someone is going to suggest that I use minute frequency data, but in this case it is not an option. With minute frequency data, the trigger and fill price behavior that I describe above is still there but less noticeable and can generally be ignored as prices do not move much each minute.