// Entry condition (for demonstration: long if price above moving average) longCondition = ta.crossover(close, maValue) if (longCondition) strategy.entry("Long", strategy.long)
// Exit conditions (exit if price crosses the upper or lower ATR bands) if (close >= upperBand) strategy.close("Long", comment="Exit on Upper ATR Band") if (close <= lowerBand) strategy.close("Long", comment="Exit on Lower ATR Band")
// Optional: Plot the moving average for reference plot(maValue, title="Moving Average", color=color.blue)