Hola Nicolás, he encontrado este indicador basado en divergencias del indicador RSI.¿Podría traducirlo?GRACIAS
//@version=2
study(“CDC RSI Divergence”, shorttitle=”CDC_RSIDV”)
// SETTING UP VARIABLES //
src = input(title=”Data Source”,type=source,defval=ohlc4)
// look back periods //
x = input(title = “short lookback period”,type=integer,defval=5)
z = input(title = “long lookback period”,type=integer,defval=25)
revpct = input(title=”Reversal Percentage”,type=float,defval=0.01)/100
alert = input(title=”Alert period”, type=integer, defval=25)
// RSI //
rsiprd = input(title=”RSI period”,type=integer,defval=14)
rv = rsi(src,rsiprd)
ob = input(title=”Overbought Level”, type=integer, defval=70)
os = input(title=”Oversold Level”, type=integer, defval=30)
// END SETUP //
////////////////////////
// BULLISH DIVERGENCE //
////////////////////////
// define lower low in price //
srcLL = src > lowest(src,x)*(1+revpct) and lowest(src,x)<lowest(src,z)[x]
// define higher low in rsi //
rsiHL = rv>lowest(rv,x) and lowest(rv,x) > lowest(rv,z)[x] and lowest(rv,x)<os
BullishDiv = srcLL and rsiHL
BullishDivAlert = iff(barssince(BullishDiv)<alert,10,0)+50
////////////////////////
// BEARISH DIVERGENCE //
////////////////////////
// define higher high in price //
srcHH = src < highest(src,x)*(1-revpct) and highest(src,x)>highest(src,z)[x]
// define lower high in RSI //
rsiLH = rv<highest(rv,x) and highest(rv,x) < highest(rv,z)[x] and highest(rv,x)>ob
BearishDiv = srcHH and rsiLH
BearishDivAlert = iff(barssince(BearishDiv)<alert,-10,0)+50
zero = plot(50)
BULLD = plot(BullishDivAlert, color = green)
BEARD = plot(BearishDivAlert, color = red)
fill(BULLD,zero,color=green, transp=50)
fill(zero,BEARD,color=red, transp=50)
plot(rv, color = blue)
plot(30, color = gray)
plot(70, color = gray)