I've been experimenting with calc_on_every_tick recently as a way to reduce the lag on position entries. One of the side effects is that it generates a ton of signals when a potential breakout is detected. A lot of these signals are then reversed and disappear from the list of trades. I think a check to see if there already has been an order entry during the bar and then restricting additional entries should work.
Something like strategy.risk.max_intraday_filled_orders() sounds like it would do the job, but it seems like it was designed to only work on daily charts. Setting an entry condition like strategy.closedtrades[0] == 0 doesn't help. pyramiding=1 only works for the first set of entry/exits and then it just continues to fire after the initial position is closed out. My goal is just to have the order entry fire once and then stick to it regardless of whether the strategy ultimately confirms the breakout or not on bar close.
Has anyone come up with a better solution to make real-time tick orders work without firing off multiple times as your strategy repaints during a potential breakout?