Buenas!
Aquí tienes el código traducido:
//---------------------------------------------------//
//Pivot Points High Low and Missed Reversal Levels
//version = 0
//09.10.2024
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
//---------------------------------------------------//
// INPUTS //
//---------------------------------------------------//
prd = 50
showMiss=1
showReg=1
//---------------------------------------------------//
// PIVOTS LOW //
//---------------------------------------------------//
src1 = low
if src1 > src1[prd] and lowest[prd](src1) > src1[prd] and src1[prd] < lowest[prd](src1)[prd+1] then
$ply[z+1] = src1[prd]
$plx[z+1] = barindex[prd]
z = z + 1
endif
//---------------------------------------------------//
// PIVOTS HIGH //
//---------------------------------------------------//
src2 = high
if src2 < src2[prd] and highest[prd](src2)<src2[prd] and src2[prd]>highest[prd](src2)[prd+1] then
$phy[t+1]=src2[prd]
$phx[t+1]=barindex[prd]
t=t+1
endif
//---------------------------------------------------//
//---------------------------------------------------//
once ghostlevel=undefined
once os=0
once px1=0
once py1=0
once maxX1=0
once minX1=0
n=barindex
mimax=max(high[prd],mimax)
mimin=min(low[prd],mimin)
followmax=max(high[prd],followmax)
followmin=min(low[prd],followmin)
if mimax > mimax[1] then
maxX1=n-prd
followmin=low[prd]
endif
if mimin < mimin[1] then
minX1=n-prd
followmax=high[prd]
endif
if followmin<followmin[1] then
followminX1=n-prd
endif
if followmax>followmax[1] then
followmaxX1=n-prd
endif
//---------------------------------------------------//
//---------------------------------------------------//
if t<>t[1] then
if showMiss then
if os[1]=1 then
drawtext("✖",minX1,mimin)coloured("green")
drawsegment(px1,py1,minX1,mimin)style(dottedline)coloured("red")
px1=minX1
py1=mimin
//GhostLevel
drawsegment(px1,py1,n-prd,py1)style(line,2)coloured("green")
elsif $phy[t]<mimax then
drawtext("✖",maxX1,mimax)coloured("red")
drawtext("✖",followminX1,followmin)coloured("green")
drawsegment(px1,py1,maxX1,mimax)style(dottedline)coloured("green")
px1=maxX1
py1=mimax
//GhostLevel
drawsegment(px1,py1,max(n-prd,px1+prd),py1)style(line,2)coloured("red")
drawsegment(px1,py1,followminX1,followmin)style(dottedline)coloured("red")
px1=followminX1
py1=followmin
//GhostLevel
drawsegment(px1,py1,max(n-prd,px1+prd),py1)style(line,2)coloured("green")
endif
endif
if showReg then
drawtext("▼",$phx[t],$phy[t])coloured("red")
if $phy[t]<mimax or os[1]=1 then
drawsegment(px1,py1,n-prd,$phy[t])style(dottedline)coloured("green")
else
drawsegment(px1,py1,n-prd,$phy[t])style(line)coloured("green")
endif
endif
py1=$phy[t]
px1=n-prd
os=1
mimax=$phy[t]
mimin=$phy[t]
endif
//---------------------------------------------------//
//---------------------------------------------------//
if z<>z[1] then
if showMiss then
if os[1]=0 then
drawtext("✖",maxX1,mimax)coloured("red")
drawsegment(px1,py1,maxX1,mimax)style(dottedline)coloured("green")
px1=maxX1
py1=mimax
//GhostLevel
drawsegment(px1,py1,max(n-prd,px1+prd),py1)style(line,2)coloured("red")
elsif $ply[z]>mimin then
drawtext("✖",followmaxX1,followmax)coloured("red")
drawtext("✖",minX1,mimin)coloured("green")
drawsegment(px1,py1,minX1,mimin)style(dottedline)coloured("red")
px1=minX1
py1=mimin
//GhostLevel
drawsegment(px1,py1,max(n-prd,px1+prd),py1)style(line,2)coloured("green")
drawsegment(px1,py1,followmaxX1,followmax)style(dottedline)coloured("green")
px1=followmaxX1
py1=followmax
//GhostLevel
drawsegment(px1,py1,max(n-prd,px1+prd),py1)style(line,2)coloured("red")
endif
endif
if showReg then
drawtext("▲",$plx[z],$ply[z])coloured("green")
if $ply[z]>mimin or os[1]=0 then
drawsegment(px1,py1,n-prd,$ply[z])style(dottedline)coloured("red")
else
drawsegment(px1,py1,n-prd,$ply[z])style(line)coloured("red")
endif
endif
py1=$ply[z]
px1=n-prd
os=0
mimax=$ply[z]
mimin=$ply[z]
endif
//---------------------------------------------------//
//---------------------------------------------------//
if islastbarupdate then
x=0
y=0
$prices[0]=0
$pricesx[0]=0
for i=0 to n-px1-1 do
if os=1 then
$prices[i]=low[i]
$pricesx[i]=n-i
else
$prices[i]=high[i]
$pricesx[i]=n-i
endif
next
if os=1 then
y=ArrayMin($prices)
for j=0 to n-px1-1 do
if low[j]=y then
x=n[j]
break
endif
next
if showmiss then
drawtext("✖",x,y)coloured("green")
drawsegment(px1,py1,x,y)style(dottedline)coloured("red")
endif
drawsegment(x,y,n,y)style(line,2)coloured("red")
else
y=arraymax($prices)
for j=0 to n-px1-1 do
if high[j]=y then
x=n[j]
break
endif
next
if showmiss then
drawtext("✖",x,y)coloured("red")
drawsegment(px1,py1,x,y)style(dottedline)coloured("green")
endif
drawsegment(x,y,n,y)style(line,2)coloured("green")
endif
endif
//---------------------------------------------------//
return