Hola Nicolas,
He encontado este interesante código,¿Sería tan amable de traducirlo a PRT?
GRACIAS
//Created by user OxoScanner 20-02-2018
//Extented RSI with Smoothing and compare agains DXY or any chosen Currency
//2 Emas Used to define change in motion
study(title=”OxoRSI”, shorttitle=”OxoRSI”)
src = close, len = input(title=”Period”,defval=104, minval=2)
Wma = input(title=”Moving Average”, defval=26, minval=2)
Smooth = input(title=”Smooth”,defval=5, minval=2)
Sym = input(title=”Versus”, type=symbol, defval=”DXY”)
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 – (100 / (1 + up / down))
band1 = hline(49.8)
band0 = hline(50.2)
rsiema= wma(rsi,Smooth)
WDma= (Wma*2)
VsRSI = security(Sym, period,rsiema)
ema= wma(rsiema,Wma)
dema= wma(rsiema,WDma)
col1 = ema[0] > ema[1] ? green : ema[0] < ema[1] ? red : orange
fill(band1, band0, color=col1, transp=0)
crise= color(#80E433,0)
// paint candles according rsi
pb = input(title=”Color Change?”, type=bool, defval=true)
thecolor=(pb and ema>= dema[2] ? close > open ? crise : green : pb and ema <= dema[2] ? close > open ? maroon : red : close > open ? blue : red)
//barcolor(thecolor)
plot(VsRSI, color=black, transp=0, linewidth=2,style=9,title=”VsRSI”)
plot(rsiema, color=blue, transp=0, linewidth=2, style=9,title=”Current”)
plot(ema, color=thecolor, transp=0, linewidth=2, title=”ema”)
plot(dema, color=col1, transp=0, linewidth=2, title=”Dema”)