OPEN-SOURCE SCRIPT

el mio

//version=5
indicator("Mi Indicador Personalizado", overlay=true)

// Parámetros ajustables
lengthMA = input.int(50, title="Longitud Media Móvil")
lengthRSI = input.int(14, title="Longitud RSI")
overbought = input.int(70, title="Nivel de Sobrecompra")
oversold = input.int(30, title="Nivel de Sobrevendido")
volumeThreshold = input.float(1.5, title="Umbral de Volumen (Múltiplo)")

// Media Móvil Simple (SMA)
sma = ta.sma(close, lengthMA)

// RSI
rsi = ta.rsi(close, lengthRSI)

// Volumen Promedio
avgVolume = ta.sma(volume, lengthMA)

// Condiciones para señales
buySignal = close > sma and rsi < oversold and volume > avgVolume * volumeThreshold
sellSignal = close < sma and rsi > overbought and volume > avgVolume * volumeThreshold

// Dibujar señales en el gráfico
plotshape(series=buySignal, title="Compra", location=location.belowbar, color=color.green, style=shape.labelup, text="COMPRA")
plotshape(series=sellSignal, title="Venta", location=location.abovebar, color=color.red, style=shape.labeldown, text="VENTA")

// Dibujar la Media Móvil
plot(sma, title="Media Móvil", color=color.blue, linewidth=2)

// Dibujar niveles de RSI
hline(overbought, "Sobrecompra", color=color.red)
hline(oversold, "Sobrevendido", color=color.green)

免責聲明