OPEN-SOURCE SCRIPT
Telah dikemas kini

Fibonacci Retracement and Target Levels

1414
Highest and Lowest Price Points:

The script calculates the highest (high_price) and lowest (low_price) prices in the specified timeframe. These values are essential for computing the Fibonacci retracement and extension levels.
Fibonacci Retracement Levels:

fib_0: 0% level (highest price).
fib_236, fib_382, fib_50, fib_618, and fib_100: These are the classic Fibonacci retracement levels used to identify potential support or resistance areas as the price retraces from its highest point.
Fibonacci Extension Levels (Targets):

fib_1618, fib_2618, and fib_4236: These are Fibonacci extension levels used to predict potential price targets in the direction of the trend if the price breaks beyond its current range.
Drawing the Levels:

The line.new function is used to draw horizontal lines on the chart representing the Fibonacci retracement and extension levels.
Dashed lines represent retracement levels.
Dotted lines represent extension (target) levels.
How to Use:
Create a new Pine Script in TradingView.
Paste the code above into the Pine Script editor.
Save the script and apply it to your chart to see Fibonacci retracement and extension levels plotted.
Nota Keluaran
Added "BUY" and "SELL" Text for Signals:

I used the plotshape() function to display the "BUY" and "SELL" labels.
The text="BUY" and text="SELL" parameters were added to the plotshape() functions to display these labels when the respective signals are triggered.
Signal Positioning:

For the "BUY" signal, I used location.belowbar, which places the "BUY" label below the price bar.
For the "SELL" signal, I used location.abovebar, which places the "SELL" label above the price bar.
Plotting Fibonacci Levels:

I ensured that the Fibonacci levels are plotted correctly on the chart using the plot() function, which helps in visualizing the Fibonacci retracement and extension levels clearly.
Result:
"BUY" and "SELL" signals are now displayed as text labels on the chart when certain conditions are met based on Fibonacci levels.
The signals will appear above or below the price bars accordingly, making it clear to the user when to potentially enter (buy) or exit (sell) the market based on Fibonacci retracement levels.
This updated version makes the "BUY" and "SELL" signals much more visible and easier to interpret.

//version=5
indicator("Fibonacci Retracement and Target Levels with Buy/Sell Signals", overlay=true)

// Kullanıcıdan en yüksek ve en düşük fiyat aralıkları için input alınması
var float high_price = na
var float low_price = na

// Fiyatların en yüksek ve en düşük noktalarını al
if (na(high_price) or high > high_price)
high_price := high
if (na(low_price) or low < low_price)
low_price := low

// Fibonacci geri çekilme seviyeleri
fib_0 = high_price
fib_236 = high_price - (high_price - low_price) * 0.236
fib_382 = high_price - (high_price - low_price) * 0.382
fib_50 = high_price - (high_price - low_price) * 0.5
fib_618 = high_price - (high_price - low_price) * 0.618
fib_100 = low_price

// Fibonacci extension (hedef seviyeleri)
fib_1618 = high_price + (high_price - low_price) * 0.618
fib_2618 = high_price + (high_price - low_price) * 1.618
fib_4236 = high_price + (high_price - low_price) * 2.618

// Fibonacci geri çekilme seviyelerini çizme (daha belirgin)
line.new(bar_index[1], fib_0, bar_index, fib_0, width=3, color=color.green, style=line.style_solid)
line.new(bar_index[1], fib_236, bar_index, fib_236, width=3, color=color.blue, style=line.style_solid)
line.new(bar_index[1], fib_382, bar_index, fib_382, width=3, color=color.blue, style=line.style_solid)
line.new(bar_index[1], fib_50, bar_index, fib_50, width=3, color=color.red, style=line.style_solid)
line.new(bar_index[1], fib_618, bar_index, fib_618, width=3, color=color.red, style=line.style_solid)
line.new(bar_index[1], fib_100, bar_index, fib_100, width=3, color=color.green, style=line.style_solid)

// Fibonacci hedef seviyelerini çizme (daha belirgin)
line.new(bar_index[1], fib_1618, bar_index, fib_1618, width=3, color=color.orange, style=line.style_solid)
line.new(bar_index[1], fib_2618, bar_index, fib_2618, width=3, color=color.orange, style=line.style_solid)
line.new(bar_index[1], fib_4236, bar_index, fib_4236, width=3, color=color.orange, style=line.style_solid)

// AL ve SAT sinyalleri
buy_signal = (close <= fib_236 and close > fib_382) // AL sinyali: Fiyat 0.236 seviyesine yakın
sell_signal = (close >= fib_618 and close < fib_50) // SAT sinyali: Fiyat 0.618 seviyesinin üstünde

// AL ve SAT sinyalleri için "BUY" ve "SELL" metinleri
plotshape(series=buy_signal, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Signal", text="BUY")
plotshape(series=sell_signal, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal", text="SELL")

// Fibonacci seviyelerini çizmek için çizgiler ekledik ve sinyalleri görselleştirdik.
plot(fib_0, color=color.green, linewidth=2, title="Fib 0%")
plot(fib_236, color=color.blue, linewidth=2, title="Fib 23.6%")
plot(fib_382, color=color.blue, linewidth=2, title="Fib 38.2%")
plot(fib_50, color=color.red, linewidth=2, title="Fib 50%")
plot(fib_618, color=color.red, linewidth=2, title="Fib 61.8%")
plot(fib_100, color=color.green, linewidth=2, title="Fib 100%")
plot(fib_1618, color=color.orange, linewidth=2, title="Fib 161.8%")
plot(fib_2618, color=color.orange, linewidth=2, title="Fib 261.8%")
plot(fib_4236, color=color.orange, linewidth=2, title="Fib 423.6%")






Nota Keluaran
Key improvements made:

Translated all comments and labels to English

Changed signal markers to use single letters (B/S) instead of full words for better readability

Added white text on colored backgrounds for better contrast

Reduced marker size using size=size.small

Used color.new() with 0 transparency for solid background colors

Maintained the original trading logic while improving visual clarity

Kept both line drawings and plots for dual confirmation (can remove plots if too crowded)

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.