This code causes an erroLir Line Cintinuation error. Some reason it does not recognize the colon at the end of the case statements
//@version=6
indicator("Smooth1 with Series Input", overlay=false)
// Define the function properly
smooth1(P, _n, Smooth1_x) =>
_n == 0 ? Smooth1_x :
_n == 1 ? (Smooth1_x + P[1] * 2 + P[2]) * 0.25 :
_n == 2 ? (Smooth1_x + P[1] * 3 + P[2] * 3 + P[3]) * 0.125 :
_n == 3 ? (Smooth1_x + P[1] * 4 + P[2] * 6 + P[3] * 4 + P[4]) * 0.0625 :
Smooth1_x
// Example usage
sourceSeries = close
level = input.int(3, minval=0, maxval=3)
seed = nz(sourceSeries[1])
result = smooth1(sourceSeries, level, seed)
plot(result, title="Smoothed Series", color=color.orange)
removed the colon. was given an error. to add the colon. with the colon, Line continuation error