I have the code for a pine script program in version 2, but I need to convert this to version 4 so that it'll be the same version as the rest of my program.
//@version=2
study("GetTrendStrategy", overlay=true)
tim=input('50')
out1 = security(tickerid, tim, open)
out2 = security(tickerid, tim, close)
plot(out1,color=red)
plot(out2,color=green)
longCondition = crossover(security(tickerid, tim, close),security(tickerid, tim, open))
plotshape(longCondition ? open : na, title="Buy", style=shape.arrowup, location=location.belowbar, size=size.normal, text="B", transp=0, textcolor = white, color=blue, transp=0)
shortCondition = crossunder(security(tickerid, tim, close),security(tickerid, tim, open))
plotshape(shortCondition ? open : na, title="Sell", style=shape.arrowdown, location=location.abovebar, size=size.normal, text="S", transp=0, textcolor = white, color=red, transp=0)