Convertir indicador RSI modificado de Tradinview a PRT
Forums › ProRealTime foro Español › Soporte ProBuilder › Convertir indicador RSI modificado de Tradinview a PRT
- This topic has 5 replies, 2 voices, and was last updated 2 years ago by
jtornex111.
-
-
03/29/2023 at 11:59 AM #212413
Hola, me gustaría poder usar el indicador de RSI modificado, que está programado en PineScript de Tradingview a la plataforma de ProRealTime.
El indicador, muestra el histórico de valores que el RSI fue alcanzando en los extremos de cada vela, dibujando dos lineas más.
Os dejo el código de PineScript. Gracias
==========
study(“3_RSI_V1a”)inpPeriod= input(title=”Period”, type=input.integer, defval=9)Sobrecompra= input(title=”Sobrecompra”, type=input.integer, defval=70)Sobreventa= input(title=”Sobreventa”, type=input.integer, defval=30)alpha=1.0/max(inpPeriod,1)RSI=rsi(close,inpPeriod)Changa_High=0.0Change_High=0.0Change_Low=0.0RSI_High=0.0Changa_Low=0.0RSI_Low=0.0FLT_MIN=1.175494351e-38diff=0.0if bar_index<=6Changa_High := close/max(inpPeriod,1)RSI_High := 50.0*(Change_High/max(Changa_High,FLT_MIN)+1)Changa_Low := close/max(inpPeriod,1)RSI_Low := 50.0*(Change_Low/max(Changa_Low,FLT_MIN)+1)elsediff := high – close[1]Change_High := Change_High[1] + alpha*(diff – Change_High[1])Changa_High := Changa_High[1] + alpha*(abs(diff) – Changa_High[1])RSI_High := 50.0*(Change_High/max(Changa_High,FLT_MIN)+1)diff := close – close[1]Change_High := Change_High[1] + alpha*(diff – Change_High[1])Changa_High := Changa_High[1] + alpha*(abs(diff) – Changa_High[1])diff := low – close[1]Change_Low := Change_Low[1] + alpha*(diff – Change_Low[1])Changa_Low := Changa_Low[1] + alpha*(abs(diff) – Changa_Low[1])RSI_Low := 50.0*(Change_Low/max(Changa_Low,FLT_MIN)+1)diff := close – close[1]Change_Low := Change_Low[1] + alpha*(diff – Change_Low[1])Changa_Low := Changa_Low[1] + alpha*(abs(diff) – Changa_Low[1])plot(RSI_High, title=’RSI High’, color=color.rgb(30,144,255), linewidth=1, style=plot.style_line, offset=0, trackprice=true)plot(RSI, title=’High’, color=color.yellow, linewidth=1, style=plot.style_line, offset=0, trackprice=true)plot(RSI_Low, title=’RSI Low’, color=color.rgb(250,128,114), linewidth=1, style=plot.style_line, offset=0, trackprice=true)band1 = hline(Sobrecompra, “Upper Band”, color = #787B86)band0 = hline(Sobreventa, “Lower Band”, color = #787B86)fill(band1, band0, color.rgb(33, 150, 243, 90), title = “Background”)03/29/2023 at 12:17 PM #21241603/29/2023 at 1:51 PM #212430Hola Nicolas, gracias por tu rápida atención. Te adjunto cómo se ve, funcionando en el par chfeur diario y respecto al código que he pegado, te adjunto el código en archivo txt, es como lo metí al Tradingview…no sé si me estás pidiendo otras cosa…
un saludo
03/29/2023 at 1:53 PM #212433Por cierto, en la captura adjunta, el rsi está dibujado con periodo 2, pero vamos, se puede configurar con cualquier periodo (14 es lo habitual). El actual indicador, permite meterle cualquiero periodo.
gracias
03/30/2023 at 8:02 AM #21248303/30/2023 at 12:17 PM #212535Muchísimas gracias, funciona perfectamente. Dá gusto tratar con gente profesional.
-
AuthorPosts
Find exclusive trading pro-tools on