Search code examples
pine-scriptpine-script-v5

Error at 15:19 no viable alternative at character ';' In Pine script


I have the following code in pine which looks like this:

strategy("My script", overlay = true)

input high = close;
input low = close;
input period = 20;
input standardDeviation = 2;

This is producing the following error:

Error at 15:19 no viable alternative at character ';'

Could you please advise how to resolve this error?


Solution

  • You should not use line terminator ';' there, instead leave it as none(blank).

    //@version=5
    
    strategy("My script", overlay = true)
    
    varhigh = input(close,"source for high:")
    varlow = input(close,"source for low:")
    period = input.int(20,"period")
    standardDeviation = input.int(2, "Standard Deviation")