Hola,
Gracias a Iván pudimos tener el indicador traducido desde Trading View. Ahora me gustaría, poder conseguir un screener que me muestre las empresas que tienen la flecha verde para arriba y las flechas rojas, para abajo.
Creo que sería algo interesante, para tenerlo.
El indicador es el siguiente, no sé cómo puedo hacer el screener para conseguir lo mencionado anteriormente.
Gracias de antemano,
Un saludo
//——————————————–//
//PRC Nadaraya-Watson Envelope
//version = 0
//28.02.24
//Iván González @ http://www.prorealcode.com
//Sharing ProRealTime knowledge
//——————————————–//
//———–Inputs—————————//
//——————————————–//
h1=8 //Bandwidth
mult=3
length=499 //Window Size
repaint=1
src=close
//——————————————–//
//———-Repaint ON————————//
//——————————————–//
if islastbarupdate and repaint then
sae=0
for i=0 to min(499,barindex-1) do
sum=0
sumw=0
for j=0 to min(499,barindex-1) do
x=i-j
w=exp(-(pow(x,2)/(h1*h1*2)))
sum=src[j]*w+sum
sumw=w+sumw
next
$y2[i]=sum/sumw
sae=sae+abs(src[i]-$y2[i])
next
sae1=sae/min(499,barindex-1)*mult
for i=min(499,barindex-1) downto 0 do
if i MOD 2 <> 0 then
drawpoint(barindex[i],$y2[i]+sae1,2)coloured(“green”)
drawpoint(barindex[i],$y2[i]-sae1,2)coloured(“red”)
endif
if close[i]>$y2[i]+sae1 and close[i+1]<=$y2[i+1]+sae1 then
drawarrowdown(barindex[i],high[i])coloured(“red”)
elsif close[i]<$y2[i]-sae1 and close[i+1]>=$y2[i+1]-sae1 then
drawarrowup(barindex[i],low[i])coloured(“green”)
endif
next
endif
//——————————————–//
//———-Repaint OFF———————–//
//——————————————–//
if repaint=0 then
once init = 1
If init = 1 then
den = 0
For i = 0 to length-1 do
$coefs[i]=exp(-(i*i)/(h1*h1*2))
den = den + $coefs[i]
Next
init = 0
Endif
out = 0
For i = 0 to length-1 do
out = out + src[i]*$coefs[i]
Next
out = out/den
mae = exponentialAverage[length](abs(src-out)) * mult
upper = out + mae
lower = out – mae
if close crosses over upper then
drawarrowdown(barindex,high)coloured(“red”)
elsif close crosses under lower then
drawarrowup(barindex,low)coloured(“green”)
endif
endif
//——————————————–//
//———-Plot Bands————————//
//——————————————–//
if repaint then
up=undefined
dw=undefined
else
up=upper
dw=lower
endif
//——————————————–//
return up as “Upper band”style(line,2)coloured(“Green”),dw as “Lower band”style(line,2)coloured(“red”)