//@version=5 strategy("Long-term purchase strategy", overlay=true) = ta.bb(close, 20, 2) plot(lower, color=color.yellow) bb = lower conditionBuy = close < bb if conditionBuy strategy.order("Buy", strategy.long, 1) if (strategy.position_size > 0) if (low < bb and (strategy.position_avg_price * 1.10) < close) strategy.close_all("Sell")