//@version=6 strategy("LANTERN price approximation", overlay = true, initial_capital = 10000, pyramiding = 0, default_qty_type = strategy.fixed, default_qty_value = 1, commission_type = strategy.commission.cash_per_order, commission_value = 1, slippage = 1, margin_long = 100, margin_short = 100) if not timeframe.isdaily runtime.error("Use daily bars") ceiling = ta.highest(close, 3)[1] signal = not na(ceiling) and close > ceiling justExited = ta.change(strategy.closedtrades) > 0 if barstate.isconfirmed if signal and strategy.position_size == 0 and not justExited strategy.entry("L", strategy.long, qty = 10) if strategy.position_size > 0 entryBar = strategy.opentrades.entry_bar_index(0) if bar_index - entryBar >= 2 strategy.close("L") plot(ceiling, "Prior three-close maximum", color.gray)