The same EMA crossover idea, written the honest way: confirmed-bar entries and a stop-loss that is actually connected. This is the baseline every strategy above is measured against.
//@version=6
// Educational only — validate before trading; not financial advice.
strategy("EMA cross (clean)", overlay = true)
fast = ta.ema(close, 12)
slow = ta.ema(close, 26)
stopPts = input.int(300, "Stop distance (points)")
if ta.crossover(fast, slow) and barstate.isconfirmed
strategy.entry("Long", strategy.long)
if strategy.position_size > 0
strategy.exit("Stop", "Long", stop = strategy.position_avg_price - stopPts * syminfo.mintick)Our engine returns a clean Strategy Health Score — no look-ahead, no repainting, no version-hygiene issues, and the stop input is genuinely wired into strategy.exit. Entries are gated to confirmed bars, so the tester and live evaluate the same way. Correctness clean is not a promise of profit; it means the code does what it says and the backtest reflects behaviour you could actually reproduce.
Code-correctness analysis only — not financial advice, and not a measure of profitability. The code shown is a representative community pattern, not any specific author's script. Trading involves substantial risk of loss.