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 open-source

In pieno spirito TradingView, l'autore di questo script lo ha pubblicato open-source, in modo che i trader possano comprenderlo e verificarlo. Un saluto all'autore! È possibile utilizzarlo gratuitamente, ma il riutilizzo di questo codice in una pubblicazione è regolato dal nostro Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Vuoi usare questo script sui tuoi grafici?

Declinazione di responsabilità