Syntax error at input 'end of line without line continuation'Pine expected a wrapped statement to continue on the next line but the indentation broke the continuation, so it read a premature line end. Educational content only; not financial advice and no profitability claim.
When one statement spans several lines, each continuation line must be indented by an amount that is NOT a multiple of 4 spaces (a multiple of 4 reads as a new code block instead of a continuation). If you break a long expression and indent the next line by 4 or 8 spaces, or leave a trailing operator with a same-level next line, the parser sees the line end before the statement is complete and raises this error. Comments placed on continuation lines cause it too.
Keep the wrapped statement on continuation lines indented by a non-multiple-of-4 (a common convention is to end the first line with the operator and indent the continuation by one or more spaces that don't total a multiple of 4). Simplest robust fix: put the whole expression on a single line, or split it into intermediate variables. Never add comments on the wrapped lines.
//@version=6
indicator("Continuation demo", overlay=true)
longSignal = ta.crossover(ta.sma(close, 10), ta.sma(close, 20)) and
close > ta.sma(close, 50)
plotshape(longSignal, title="Long")✓ Validated clean by our own engine
//@version=6
indicator("Continuation demo", overlay=true)
fast = ta.sma(close, 10)
slow = ta.sma(close, 20)
trend = ta.sma(close, 50)
longSignal = ta.crossover(fast, slow) and close > trend
plotshape(longSignal and barstate.isconfirmed, title="Long", style=shape.triangleup, location=location.belowbar, color=color.green)Educational, code-correctness reference only — not financial advice. Trading involves substantial risk of loss.