Screener Nadaraya Watson Envelope
Forums › ProRealTime foro Español › Soporte ProScreener › Screener Nadaraya Watson Envelope
- This topic has 3 replies, 2 voices, and was last updated 10 hours ago by Iván.
-
-
02/02/2025 at 9:31 PM #243351
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])
nextsae1=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 = 1If 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
Endifout = 0
For i = 0 to length-1 do
out = out + src[i]*$coefs[i]
Nextout = out/den
mae = exponentialAverage[length](abs(src-out)) * multupper = out + mae
lower = out – maeif 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”)02/03/2025 at 11:52 AM #243362Hola!
Aquí lo tienes (+1 flecha verde / -1 flecha roja):12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849//--------------------------------------------////PRC Nadaraya-Watson Envelope//version = 0//28.02.24//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge//--------------------------------------------////-----------Inputs---------------------------////--------------------------------------------//h1=8 //Bandwidthmult=3length=499 //Window Size//repaint=1src=close//--------------------------------------------////----------Repaint OFF-----------------------////--------------------------------------------//once init = 1If init = 1 thenden = 0For i = 0 to length-1 do$coefs[i]=exp(-(i*i)/(h1*h1*2))den = den + $coefs[i]Nextinit = 0Endifout = 0For i = 0 to length-1 doout = out + src[i]*$coefs[i]Nextout = out/denmae = exponentialAverage[length](abs(src-out)) * multupper = out + maelower = out - maeif close crosses over upper thensetup=-1elsif close crosses under lower thensetup=1elsesetup=0endifscreener[setup<>0](setup as "Setup")02/04/2025 at 7:59 AM #243434Hola,
Me pone lo siguiente al ejecutar: Este ProScreener no puede ejecutarse: una de las instrucciones contiene un offset negativo o de un valor excesivo (p.ej:low[-1] o low[300].
Los valores de offset han de ser números enteros entre 0 y 254.
Gracias de antemano,
Un saludo
02/04/2025 at 9:21 AM #243437 -
AuthorPosts
Find exclusive trading pro-tools on