How to execute order during gap open on next bar ?

May be I have misconception on using the backtrader. Suppose I have a strategy to calculate a target price to buy (or sell). In the next():, I issued an order with StopLimit. If the target price is within next day's high low range, it triggers exactly at the target price. That matches my expectation.

But if there is a gap, it never trigger.

What I want is, whenever the market break away from the target price, I will enter the market, at that price if possible, otherwise at the market price. I tried different order types, still cannot get this to work.

What I want is, whenever the market break away from the target price, I will enter the market, at that price if possible, otherwise at the market price

If you issue a StopLimit you can only enter at the Limit or at a better price. You CANNOT enter at a worse price (which seems the implication from "breakaway, i.e.: the price runs away from your order) and you CANNOT enter at Market price.

The best you can do is explain your scenario with exact orders, prices and market movement.

I calculated the top yellow line and projected a target price, if it penetrates, enter the market with buy order. So, with StopLimit and if the next day open below the target price and penetrate up, it works perfectly. My strategy is to buy even if gap opening above the target price happened, then just buy at open price or market price, how can I simulate that ?