i am unable to remove the syntax error at input. it is showing for below coding. Can someone check and send me back the running script without any syntax. it is for pine script in trading view. thanks for the help. The code is as below and the problem is occurring at : "if crossed" line, showing syntax error.
//@version=4
par1=input(21)
par2=input(55)
ema1=ema(close,par1)
ema2=ema(close,par2)
buy=ema1>ema2
sell=ema2>ema1
mycolor= iff(buy,color.green,iff(sell,color.blue,color.red))
barcolor(color=mycolor)
ema100=ema(close,100)
ibuy=crossover(ema1,ema2)
iSell=crossunder(ema1,ema2)
//iSell=crossunder(close,ema1)
Varp=tostring(close[1])
crossed =crossover(ema(close,par1),ema(close,par2))
if crossed
I = label.new(bar_index,na,tostring(close))
color=color.green,
textcolor=color.white,
style=label.style_labelup,yloc=yloc.belowbar)
crossed2 =crossunder(ema(close,par1),ema(close,par2))
if crossed2
I = label.new(bar_index.na,tostring(close))
color=color.red,
textcolor=color.white,
style=label.style_labeldown,yloc=yloc.abovebar)
plot(ema(close,par1),"EMA Short",color=color.blue)
plot(ema(close,par2),"EMA Long",color=color.orange)
longCondition = crossover(ema(close,par1),ema(close,par2))
if (longCondition)
strategy.entry("My Long Entry Id",strategy.long)
shortCondition = crossunder(ema(close,par1),ema(close,par2))
if (shortCondition)
strategy.entry("My Short Entry Id",strategy.short)