Need some help here, I have Trading view Pine script code which I need converting. I was able to get somewhere close but there is definately something I am missing which is making things little difficult.
Pine Script
indicator(“Pivot Lines”, overlay = true)
source = close
value = 14
var plv = 0.0
var phv = 0.0
pl= ta.pivotlow(low,value,value)
ph=ta.pivothigh(high,value,value)
if(pl!=plv)
plv:=pl
if(ph!=phv)
phv:=ph
plot(phv, color=color.blue)
plot(plv, color=color.red)
That’s a Fractal with a custom period, here you go:
cp = 14
if high[cp] >= highest[2*cp+1](high) then
LH = 1
else
LH=0
endif
if low[cp] <= lowest[2*cp+1](low) then
LL= -1
else
LL=0
endif
if LH=1 then
hil = high[cp]
endif
if LL = -1 then
LOL=low[cp]
endif
return hil,lol