OPEN-SOURCE SCRIPT

RSI Volume Fibonacci Strategy

//version=5
strategy("RSI Volume Fibonacci Strategy", overlay=true)

// Parameters
rsiPeriod = input.int(14, title="RSI Period", minval=1)
rsiOverbought = input.int(70, title="RSI Overbought Level", minval=50)
rsiOversold = input.int(30, title="RSI Oversold Level", minval=1)

fibHigh = request.security(syminfo.tickerid, "D", ta.highest(high, 100)) // Fibonacci on daily high
fibLow = request.security(syminfo.tickerid, "D", ta.lowest(low, 100)) // Fibonacci on daily low

fibLevel_0 = fibLow
fibLevel_1 = fibLow + (fibHigh - fibLow) * 0.236
fibLevel_2 = fibLow + (fibHigh - fibLow) * 0.382
fibLevel_3 = fibLow + (fibHigh - fibLow) * 0.5
fibLevel_4 = fibLow + (fibHigh - fibLow) * 0.618
fibLevel_5 = fibHigh

// Plot Fibonacci Levels
plot(fibLevel_0, color=color.green, linewidth=1, title="0% Fibonacci Level")
plot(fibLevel_1, color=color.green, linewidth=1, title="23.6% Fibonacci Level")
plot(fibLevel_2, color=color.blue, linewidth=1, title="38.2% Fibonacci Level")
plot(fibLevel_3, color=color.yellow, linewidth=1, title="50% Fibonacci Level")
plot(fibLevel_4, color=color.red, linewidth=1, title="61.8% Fibonacci Level")
plot(fibLevel_5, color=color.red, linewidth=1, title="100% Fibonacci Level")

// RSI Calculation
rsiValue = ta.rsi(close, rsiPeriod)

// Volume condition
averageVolume = ta.sma(volume, 20) // 20-period simple moving average of volume
highVolume = volume > averageVolume // Condition for high volume

// Buy when RSI is oversold and price is above a certain Fibonacci level and volume is high
if (rsiValue < rsiOversold and close > fibLevel_2 and highVolume)
strategy.entry("Long", strategy.long)

// Sell when RSI is overbought and price is below a Fibonacci level and volume is high
if (rsiValue > rsiOverbought and close < fibLevel_4 and highVolume)
strategy.entry("Short", strategy.short)

// Plot RSI on a separate chart
plot(rsiValue, title="RSI", color=color.purple, linewidth=2)
hline(rsiOverbought, "RSI Overbought", color=color.red)
hline(rsiOversold, "RSI Oversold", color=color.green)
Bill Williams Indicators

Script de código abierto

Siguiendo fielmente el espíritu de TradingView, el autor de este script lo ha publicado en código abierto, permitiendo que otros traders puedan entenderlo y verificarlo. ¡Olé por el autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la reutilización de este código en la publicación se rige por las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

¿Quiere utilizar este script en un gráfico?

Exención de responsabilidad