Add to Chart operation failed, reason: line N: Cannot call 'operator +' with argument of type 'series string'This runtime type error means you tried to + a non-string value onto a string without converting it first — Pine's + does not auto-cast numbers to text. Educational content only; not financial advice and no profitability claim.
The + operator in Pine requires both operands to be the same type. When you concatenate a string with an int/float (or bool), one side ends up 'series string' and the other a number, and there is no implicit conversion, so the overload cannot be resolved. It usually surfaces when building label.new() text or an alert message like "RSI: " + rsiValue, where rsiValue is a float. The message often reports it as a 'series string' argument mismatch on the numeric side.
Wrap every non-string value in str.tostring() (optionally with a format string) before concatenating, so both sides of + are strings. For formatted output prefer str.format(). Gate any label/alert that fires a signal with `and barstate.isconfirmed` so it only draws on confirmed bars.
//@version=6
indicator("Type demo", overlay=true)
rsiValue = ta.rsi(close, 14)
labelText = "RSI: " + rsiValue
if barstate.islast
label.new(bar_index, high, labelText)✓ Validated clean by our own engine
//@version=6
indicator("Type demo", overlay=true)
rsiValue = ta.rsi(close, 14)
labelText = "RSI: " + str.tostring(rsiValue, "#.##")
if barstate.islast and barstate.isconfirmed
label.new(bar_index, high, labelText, style=label.style_label_down)Educational, code-correctness reference only — not financial advice. Trading involves substantial risk of loss.