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

Skrip sumber terbuka

Dalam semangat sebenar TradingView, penulis telah menerbitkan kod Pine ini sebagai sumber terbuka supaya pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda boleh menggunakan perpustakaan ini secara percuma, tetapi penggunaan semula kod dalam penerbitan ini adalah dikawal oleh Peraturan dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Ingin menggunakan skrip ini pada carta?

Penafian