OPEN-SOURCE SCRIPT
Fibonacci 61.8 BUY or SELL (EMA-Filtered)

This indicator helps identify Fibonacci-based Buy or Sell zones based on recent pivot highs/lows, but only when filtered by the EMA trend.
✅ Buy Zones: Only when price is above EMA
✅ Sell Zones: Only when price is below EMA
🟩 Draws a 61.8% Fibonacci retracement line
🟥 Adds a label with price value: BUY @ or SELL @
📏 All drawing is based on pivot structure (LL → LH for buy; HH → HL for sell)
📊 EMA Trend Filter
Only draws buy setups when price > EMA
Only draws sell setups when price < EMA
You can change the EMA length:
📈 How It Works – Step by Step
✅ BUY SETUP (LL → LH, only if price > EMA):
Detects pivot low → stores as prevLow
Detects pivot high after that → stores as prevHigh
Calculates Fib Level:
fibLevel = prevLow + (prevHigh - prevLow) * 0.618
Draws a green dashed line at that fib level
Adds a label to the right:
"BUY @ price"
🚫 SELL SETUP (HH → HL, only if price < EMA):
Detects pivot high → stores as prevHigh
Detects pivot low after that → stores as prevLow
Calculates Fib Level:
fibLevel = prevHigh - (prevHigh - prevLow) * 0.618
Draws a red dashed line at that fib level
Adds a label to the right:
"SELL @ price"
✅ Strengths
Simple yet powerful EMA + Fibonacci strategy
Visually clean: only one signal shown at a time
Customizable: style, color, width, offset, precision
Works well for trend continuation trades
⚠️ Limitations
Only shows latest setup, not historical signals
Does not show price breaking fib level or reacting to it
Assumes fixed 61.8% retracement—no multi-level analysis
Doesn't differentiate between minor and major pivots
📌 How to Trade It
🟢 BUY Example:
Price above EMA
Pivot Low → Pivot High → 61.8% level plotted
Wait for price to react at that level to go long
🔴 SELL Example:
Price below EMA
Pivot High → Pivot Low → 61.8% level plotted
Wait for price to react at that level to go short
✅ Buy Zones: Only when price is above EMA
✅ Sell Zones: Only when price is below EMA
🟩 Draws a 61.8% Fibonacci retracement line
🟥 Adds a label with price value: BUY @ or SELL @
📏 All drawing is based on pivot structure (LL → LH for buy; HH → HL for sell)
📊 EMA Trend Filter
Only draws buy setups when price > EMA
Only draws sell setups when price < EMA
You can change the EMA length:
📈 How It Works – Step by Step
✅ BUY SETUP (LL → LH, only if price > EMA):
Detects pivot low → stores as prevLow
Detects pivot high after that → stores as prevHigh
Calculates Fib Level:
fibLevel = prevLow + (prevHigh - prevLow) * 0.618
Draws a green dashed line at that fib level
Adds a label to the right:
"BUY @ price"
🚫 SELL SETUP (HH → HL, only if price < EMA):
Detects pivot high → stores as prevHigh
Detects pivot low after that → stores as prevLow
Calculates Fib Level:
fibLevel = prevHigh - (prevHigh - prevLow) * 0.618
Draws a red dashed line at that fib level
Adds a label to the right:
"SELL @ price"
✅ Strengths
Simple yet powerful EMA + Fibonacci strategy
Visually clean: only one signal shown at a time
Customizable: style, color, width, offset, precision
Works well for trend continuation trades
⚠️ Limitations
Only shows latest setup, not historical signals
Does not show price breaking fib level or reacting to it
Assumes fixed 61.8% retracement—no multi-level analysis
Doesn't differentiate between minor and major pivots
📌 How to Trade It
🟢 BUY Example:
Price above EMA
Pivot Low → Pivot High → 61.8% level plotted
Wait for price to react at that level to go long
🔴 SELL Example:
Price below EMA
Pivot High → Pivot Low → 61.8% level plotted
Wait for price to react at that level to go short
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.