Error: Syntax error at input 'LongStop'

RonaldS

New member
I'm getting the error "line 16: Syntax error at input 'LongStop'"
I don't know what the error could be. I hope someone can help, thanks

//@version=4
strategy("Heiken Ashi Price Action", overlay=true)
plot(close)

//Set potential stop
LongStop = 0
ShortStop = 0
if low < low[1]
LongStop := low
else
LongStop := low[1]

if LongStop := low[1] and low[2] < low[1] // Line 16
LongStop := low[2]

if LongStop := low and low[2] < low
LongStop := low[2]

if high > high[1]
ShortStop := high
else
ShortStop := high[1]

if ShortStop := high[1] and high[2] > high[1]
ShortStop := high[2]

if ShortStop := high and high[2] > high
ShortStop := high[2]
 
You're probably trying to compare LongStop to low[1] for equality. If so, you need to use LongStop == low[1]. := is the assignment operator for mutable variables. The same thing occurs a few more times.
 
Top
Contact Us