MTF Round Level Reversal [RunRox]🧲 MTF Round Level Reversal is an indicator designed to highlight price levels on the chart where the market encountered significant resistance or support at round numbers, failing to break through large clusters of orders.
In many cases, price revisits these round-number levels to absorb the remaining liquidity, offering potential reversal or continuation trade opportunities.
✏️ EXAMPLE
Here’s an example demonstrating how this indicator works and how its logic is structured:
As shown in the screenshot above, price encountered resistance at round-number levels, clearly reacting off these areas.
Afterward, the market pulled back, presenting opportunities to enter trades targeting these previously established open levels.
This logic is based on the observation that price often seeks to revisit these open round-number levels due to the residual liquidity resting there.
While effective across various markets, this indicator performs particularly well with stocks or assets priced at higher values.
For a level to appear on the chart, price must first encounter a round-number value and clearly reverse from it, leaving a visible reaction on the chart. After this occurs, the indicator will mark this level as fully formed and display it as an active reversal area.
⚙️ SETTINGS
🔷 Timeframe – Choose any timeframe from which you’d like the indicator to source level data.
🔷 Period – Defines the number of candles required on both sides (left and right) to confirm and fully form a level.
🔷 Rounding Level – Adjusts price rounding precision when detecting levels (from 0.0001 up to 5000).
🔷 Color – Customize the color and transparency of displayed levels.
🔷 Line Style – Select the desired line style for level visualization.
🔷 Label Size – Set the font size for the level labels displayed on the chart.
🔷 Move Label to the Right – Move level labels to the right side of the screen for better visibility.
🔷 Label Offset – Specifies how many bars labels should be offset from the chart’s right edge.
🔷 Delete Filled Level – Automatically removes levels from the chart after they’ve been revisited or filled.
🔷 Calculation Bars – Determines the number of recent bars considered when calculating and identifying levels.
🔶 There are numerous ways to apply this indicator in your trading strategy. You can look for trades targeting these round-number levels or identify reversal setups forming at these high-liquidity zones. The key insight is understanding that these levels represent significant liquidity areas, which price frequently revisits and retests.
We greatly appreciate your feedback and suggestions to further improve and enhance this indicator!
Candlestick analysis
Time Box Breakout IndicatorPlots Boxes with breakout signals on whatever timeframe the user selects.
Allows for users to see higher timeframe ranges on lower timeframes.
Useful for scalpers taking advantage of momentum, combined with support and resistance on higher timeframes.
Aids in visualizing risk, ranges and trends.
Hierarchical + K-Means Clustering Strategy===== USER GUIDE =====
Hierarchical + K-Means Clustering Strategy
OVERVIEW:
This strategy combines hierarchical clustering and K-means algorithms to analyze market volatility patterns
and generate trading signals. It uses a modified SuperTrend indicator with ATR-based volatility clustering
to identify potential trend changes and market conditions.
KEY FEATURES:
- Advanced volatility analysis using hierarchical clustering and K-means algorithms
- Modified SuperTrend indicator for trend identification
- Multiple filter options including moving average and ADX trend strength
- Volume-based exit mechanism to protect profits
- Customizable appearance settings
SETTINGS EXPLANATION:
1. SuperTrend Settings:
- ATR Length: Period for ATR calculation (default: 11)
- SuperTrend Factor: Multiplier for ATR to determine trend bands (default: 3)
2. Hierarchical Clustering Settings:
- Training Data Length: Number of bars used for clustering analysis (default: 200)
3. Appearance Settings:
- Transparency 1 & 2: Control the opacity of trend lines and fills
- Bullish/Bearish Color: Colors for uptrend and downtrend visualization
4. Time Settings:
- Start Year/Month: Define when the strategy should start executing trades
5. Filter Settings:
- Moving Average Filter: Uses SMA to filter trades (only enter when price is on correct side of MA)
- Trend Strength Filter: Uses ADX to ensure trades are taken in strong trend conditions
6. Volume Stop Loss Settings:
- Volume Ratio Threshold: Controls sensitivity of volume-based exits
- Monitoring Delay Bars: Number of bars to wait before monitoring volume for exit signals
HOW TO USE:
1. Apply the indicator to your chart
2. Adjust settings according to your trading preferences and timeframe
3. Long signals appear when price crosses above the SuperTrend line (▲k marker)
4. Short signals appear when price crosses below the SuperTrend line (▼k marker)
5. The strategy automatically manages exits based on volume balance conditions
INTERPRETATION:
- Green line/area: Bullish trend - consider long positions
- Red line/area: Bearish trend - consider short positions
- Yellow line: Moving average for additional trend confirmation
- Volume balance exits occur when buying/selling pressure equalizes
RECOMMENDED TIMEFRAMES:
This strategy works best on 1H, 4H, and daily charts for most markets.
For highly volatile assets, shorter timeframes may also be effective.
RISK MANAGEMENT:
Always use proper position sizing and consider setting additional stop losses
beyond the strategy's built-in exit mechanisms.
===== END OF USER GUIDE =====
Fiyat ve Mavi Çizgi Kesişimi ve RSI, Fibonacci, MACDüçü bir arada ve tüm zaman larda uygun macd rsi ve fibonaci kullarak grafik üzerinde değerleri yazıyor
Collatz Dual Number CalculatorCollatz Dual Number Calculator. Counting the number of candles associated with the chart using the Collatz conjecture, which is calculated as two input numbers. The output is displayed on the left side of the image.
Distancia a EMA25 y % de Cierres
Línea Roja (% Cierres Sobre EMA)
Indica el porcentaje de velas (dentro de tu lookback, por ejemplo 50 barras) que han cerrado por encima de la EMA25.
Si está en valores altos (por ejemplo, 70-80%), significa que en la mayoría de las últimas 50 velas el precio ha cerrado por encima de la EMA, lo cual sugiere un sesgo alcista o, al menos, una fortaleza relativa del precio frente a la EMA.
Línea Naranja (% Cierres Bajo EMA)
Representa el porcentaje de velas que han cerrado por debajo de la EMA25 en el mismo período.
Al ser complementaria, la suma de la línea roja y la naranja debe dar 100%.
Si esta línea es más alta que la roja, indica que la mayoría de velas cierran por debajo de la EMA25, sugiriendo un sesgo bajista.
Distancia % (Precio - EMA25)
Dependiendo de cómo lo hayas configurado, podrías ver una línea o un valor numérico que mide cuán lejos está el precio de la EMA25 en términos porcentuales.
Si este valor se aleja mucho de 0 (por ejemplo, +2% o -2%), indica que el precio se ha separado bastante de su media, lo que a veces se interpreta como un posible punto de sobreextensión (sobrecompra o sobreventa, según la dirección).
TMA StrategyThe **TMA Strategy** is a trend-following strategy that leverages **Smoothed Moving Averages (SMMA)** and **candlestick patterns** to identify high-probability trading opportunities. It is designed for traders who want to capture strong trends while minimizing noise from short-term fluctuations.
**Key Features:**
✔ **Multiple Smoothed Moving Averages (SMMA):** Uses 21, 50, 100, and 200-period SMMAs to identify market trends and key support/resistance zones.
✔ **Candlestick Pattern Confirmation:** Incorporates **3-line strike** and **engulfing candle** patterns to confirm trade entries.
✔ **Dynamic Trend Filter:** A **2-period EMA** ensures that trades align with the dominant trend, reducing false signals.
✔ **Customizable Session Filter:** Allows users to enable/disable trading within specific market sessions (New York, London, Tokyo, etc.), ensuring trades are executed only during high-liquidity hours.
✔ **Risk Management:** Uses predefined exit conditions based on EMA/SMMA crossovers to lock in profits and minimize losses.
**Trading Logic:**
📌 **Long Entry:**
- Bullish Engulfing or 3-Line Strike pattern appears.
- Price is above the 200 SMMA.
- 2 EMA confirms an uptrend.
- Trade executes if session filter allows.
📌 **Short Entry:**
- Bearish Engulfing or 3-Line Strike pattern appears.
- Price is below the 200 SMMA.
- 2 EMA confirms a downtrend.
- Trade executes if session filter allows.
📌 **Exit Conditions:**
- Long trades exit when EMA(2) crosses **below** SMMA(200).
- Short trades exit when EMA(2) crosses **above** SMMA(200).
**Ideal Markets & Timeframes:**
✅ Best suited for **Forex, Stocks, and Crypto** markets.
✅ Works well on **higher timeframes (15m, 1H, 4H, Daily)** for stronger trend confirmation.
📢 **Disclaimer:**
This strategy is for educational purposes only. Backtest results do not guarantee future performance. Always use proper risk management and test in a demo account before live trading.
🚀 **Try the TMA Strategy now and enhance your trend-following approach!**
Buy/Sell StrategyStrategy Description:
This strategy combines technical analysis with short-term buy and sell signals to help you optimize profits. To enhance your results, it's essential to incorporate additional technical indicators, such as moving averages, for better profitability.
Remove Gaps (Superimposed)This to delete the gap, is to delete all gap that show the graph when it starts with a a gap
Multi-EMA Combination with Multi-Timeframe EMA By BCB ElevateBenefits and Features of the Multi-EMA Combination Indicator with Multi-Timeframe EMA:
Key Features:
Multiple EMA Support:
Tracks up to six EMAs simultaneously, each with customizable lengths and colors.
Allows traders to observe various short-term and long-term trends in the market.
Multi-Timeframe EMA (MTF EMA):
Incorporates a higher timeframe EMA directly into the current chart.
Useful for aligning intraday trading strategies with broader market trends.
Provides customizable settings, including the EMA length and timeframe.
Combined Alerts:
Automated alerts for key crossover and crossunder events.
Alerts include:
EMA 1 crossing EMA 2 (shorter-term signals).
EMA 1 crossing EMA 2 and EMA 3 together (stronger confirmation signals).
Can enable or disable buy and sell alerts separately.
Customizability:
Users can set EMA lengths, colors, and other preferences directly from the settings menu.
The multi-timeframe EMA can be toggled on/off for flexibility.
User-Friendly Visuals:
Clearly plots EMAs with different colors and line widths to distinguish trends.
The multi-timeframe EMA uses a unique style for better visibility.
High Volume & Chart Patternsit indicates high volume with 150 percent . useful at support and resistence
Spekulator Maliyet Analizi Pro V4//@version=6
indicator('Spekulator Maliyet Analizi Pro V4', overlay = true, max_labels_count = 500, max_lines_count = 500)
// =================== GLOBAL DEĞİŞKENLER ===================
// Trend değişkenleri
var bool uptrend = false
var float last_swing_low = na
var float last_swing_high = na
var int last_swing_low_index = na
var int last_swing_high_index = na
// Maliyet değişkenleri
var float alis_maliyeti = na
var float satis_maliyeti = na
var float alis_maliyeti_alt = na
var float alis_maliyeti_ust = na
var float satis_maliyeti_alt = na
var float satis_maliyeti_ust = na
// Pozisyon değişkenleri
var bool pozisyonda = false
var bool son_islem_alis = false
var float giris_fiyati = na
var float cikis_fiyati = na
var int son_giris_cikis_zamani = 0
var float max_kar = 0.0
var float max_zarar = 0.0
var float curr_kar = 0.0
var bool olasi_alis = false
var bool olasi_satis = false
var bool alis_sinyal = false
var bool satis_sinyal = false
var float trailing_stop_seviyesi = na
var float trailing_stop_max = na
var float trailing_stop_min = na
var bool alis_yapildi = false
var bool satis_yapildi = false
// Sinyal kosullari
var bool alis_kosul_1 = false
var bool satis_kosul_1 = false
var bool alis_filtre = false
var bool satis_filtre = false
var bool alis_ek_kosul = false
var bool satis_ek_kosul = false
var bool alis_pozisyon_kosul = false
var bool satis_pozisyon_kosul = false
var bool pozisyon_kisitlama_alis = false
var bool pozisyon_kisitlama_satis = false
var bool alis_crossover = false
var bool satis_crossunder = false
var float olasi_alis_seviyesi = na
var float olasi_satis_seviyesi = na
// Crossover/Crossunder değişkenleri
var bool alis_tp_crossover = false
var bool satis_tp_crossunder = false
var bool alis_sl_crossunder = false
var bool satis_sl_crossover = false
var bool trailing_stop_crossunder = false
// Pre-calculated check variables
var bool alis_tp_crossover_check = false
var bool alis_sl_crossunder_check = false
var bool satis_tp_crossunder_check = false
var bool satis_sl_crossover_check = false
var bool trailing_stop_crossunder_check = false
// POC değişkenleri (Point of Control)
var float poc_fiyat = na
var float poc_hacim = 0.0
var float poc_yuzde = 0.0
var float rsi = na
var float rsi_deger = na
var bool rsi_alis_kosul = true
var bool rsi_satis_kosul = true
var float alis_sl = na
var float alis_tp = na
var float satis_sl = na
var float satis_tp = na
var color poc_renk = color.white
var string poc_metin = ""
// Volatilite değişkenleri
var float volatilite = na
var float volatilite_ort = na
var float fiyat_degisim_yuzde = 0.0
var bool siradisi_fiyat = false
var bool siradisi_hacim = false
var bool siradisi_volatilite = false
var bool siradisi_hareket = false
var bool siradisi_alis = false
var bool siradisi_satis = false
var bool yukselen_mumlar = false
var bool dusen_mumlar = false
var float swing_yuksek = na
var float swing_dusuk = na
var float hacim_orani = 0.0
var float vol_sma = 0.0
var bool yuksek_hacim = false
var table table_obj = na
// VPVR Değişkenleri
var float vpvr_poc_fiyat = na
var bool vpvr_ustunde = false
var color vpvr_poc_renk = color.gray
var string vpvr_poc_metin = ""
var float vpvr_poc_hacim = 0.0
var float vpvr_poc_yuzde = 0.0
// Histogram veri dizileri
var float vpvr_histogram_alt_liste = array.new_float()
var float vpvr_histogram_ust_liste = array.new_float()
var float vpvr_histogram_fiyat_liste = array.new_float()
var float vpvr_histogram_alim_hacmi_liste = array.new_float()
var float vpvr_histogram_satim_hacmi_liste = array.new_float()
var float vpvr_histogram_hacim_yuzde_liste = array.new_float()
// Görsel objeler için diziler
var box vpvr_alim_kutulari = array.new_box()
var box vpvr_satim_kutulari = array.new_box()
var line vpvr_cizgiler = array.new_line()
// =================== GORSEL AYARLAR ===================
g_grup1 = "Gorsel Ayarlar - Renkler"
i_alis_renk = input.color(color.green, "Alis Bölgesi Rengi", group=g_grup1)
i_satis_renk = input.color(color.red, "Satis Bölgesi Rengi", group=g_grup1)
i_ok_renk_alis = input.color(color.green, "Alis Ok Rengi", group=g_grup1)
i_ok_renk_satis = input.color(color.red, "Satis Ok Rengi", group=g_grup1)
i_olasi_alis_renk = input.color(color.new(color.green, 50), "Olası Alış Rengi", group=g_grup1)
i_olasi_satis_renk = input.color(color.new(color.red, 50), "Olası Satış Rengi", group=g_grup1)
i_sl_renk = input.color(color.red, "Stop Loss Rengi", group=g_grup1)
i_tp_renk = input.color(color.green, "Take Profit Rengi", group=g_grup1)
i_panel_yazi_renk = input.color(color.white, "Panel Yazı Rengi", group=g_grup1)
i_panel_baslik_renk = input.color(color.yellow, "Panel Başlık Rengi", group=g_grup1)
i_panel_renk = input.color(color.new(color.black, 90), "Panel Arka Plan Rengi", group=g_grup1)
g_grup2 = "Gorsel Ayarlar - Stil"
i_cizgi_kalinlik = input.int(2, "Ana Çizgi Kalınlığı", minval=1, maxval=4, group=g_grup2)
i_sl_tp_kalinlik = input.int(1, "SL/TP Çizgi Kalınlığı", minval=1, maxval=4, group=g_grup2)
i_panel_konum = input.string("Sag Üst", "Panel Konumu", options= , group=g_grup2)
i_panel_saydamlik = input.int(50, "Panel Saydamlığı", minval=0, maxval=100, group=g_grup2)
g_grup3 = "Hesaplama - Swing Ayarları"
i_swing_periyot = input.int(10, "Swing Periyodu", minval=5, maxval=50, group=g_grup3, tooltip="Swing noktalarını belirlemek için kullanılacak periyot")
i_swing_yuzde = input.float(1.5, "Min. Swing (%)", minval=0.5, step=0.1, group=g_grup3, tooltip="Minimum swing hareketi yüzdesi")
i_swing_onay = input.int(3, "Swing Onay Mumu", minval=1, maxval=5, group=g_grup3, tooltip="Swing noktasının onaylanması için gereken mum sayısı")
i_pivot_lookback = input.int(10, "Pivot Lookback", minval=5, maxval=50, group=g_grup3, tooltip="Pivot noktalarını belirlemek için kullanılacak periyot")
g_grup4 = "Hesaplama - Fibonacci Ayarları"
i_fib_seviye = input.float(0.618, "Ana Fibonacci Seviyesi", minval=0.1, maxval=1.0, step=0.001, group=g_grup4)
i_fib_alt = input.float(0.5, "Alt Fibonacci Seviyesi", minval=0.1, maxval=1.0, step=0.001, group=g_grup4)
i_fib_ust = input.float(0.786, "Üst Fibonacci Seviyesi", minval=0.1, maxval=1.0, step=0.001, group=g_grup4)
g_grup5 = "Risk Yönetimi"
i_sl_yuzde = input.float(1.5, "Stop Loss (%)", minval=0.5, step=0.1, group=g_grup5)
i_tp_yuzde = input.float(3.0, "Take Profit (%)", minval=1.0, step=0.1, group=g_grup5)
i_trailing_stop = input.bool(false, "Trailing Stop Kullan", group=g_grup5)
i_trailing_yuzde = input.float(1.0, "Trailing Stop (%)", minval=0.5, step=0.1, group=g_grup5)
g_grup6 = "Filtreler"
i_rsi_aktif = input.bool(false, "RSI Filtresini Kullan", group=g_grup6)
i_rsi_period = input.int(14, "RSI Periyodu", minval=1, group=g_grup6)
i_rsi_ust = input.int(70, "RSI Üst Sınır", minval=50, maxval=100, group=g_grup6)
i_rsi_alt = input.int(30, "RSI Alt Sınır", minval=0, maxval=50, group=g_grup6)
i_hacim_aktif = input.bool(false, "Hacim Filtresini Kullan", group=g_grup6)
i_hacim_period = input.int(20, "Hacim Ortalama Periyodu", minval=1, group=g_grup6)
i_hacim_carpan = input.float(1.5, "Hacim Çarpanı", minval=1.0, step=0.1, group=g_grup6)
g_grup7 = "Sinyal Ayarları"
i_alis_sinyal_seviyesi = input.float(0.0, "Alış Sinyal Seviyesi (%)", minval=-100, maxval=100, step=0.1, group=g_grup7)
i_satis_sinyal_seviyesi = input.float(0.0, "Satış Sinyal Seviyesi (%)", minval=-100, maxval=100, step=0.1, group=g_grup7)
i_sinyal_tetik_yuzde = input.float(2.0, "Sinyal Mesafesi (%)", minval=0.1, maxval=10.0, step=0.1, group=g_grup7, tooltip="Maliyet seviyesine göre sinyal mesafesi")
i_sinyal_ters_yon = input.bool(true, "Sadece Ters Yön Sinyalleri", group=g_grup7, tooltip="Aktif olduğunda, sadece önceki sinyalin tersi yönünde sinyal üretir")
i_sinyal_pozisyon_kontrol = input.bool(true, "Pozisyon Kontrolü", group=g_grup7, tooltip="Aktif olduğunda, pozisyondayken aynı yönde sinyal üretmez")
g_grup8 = "Olası Sinyal Ayarları"
i_olasi_sinyal_hassasiyeti = input.float(0.5, "Olası Sinyal Hassasiyeti (%)", minval=0.1, maxval=5.0, step=0.1, group=g_grup8)
// =================== YENİ EKLENTİ: SIRA DIŞI HAREKET ALGILAMA ===================
g_grup10 = "Sıra Dışı Hareket Algılama"
i_siradisi_fiyat_yuzde = input.float(3.0, "Ani Fiyat Değişimi (%)", minval=0.5, step=0.1, group=g_grup10, tooltip="Bu yüzdenin üzerindeki ani fiyat değişimleri anormal hareket olarak işaretlenir")
i_siradisi_hacim_carpan = input.float(2.5, "Hacim Artış Çarpanı", minval=1.5, step=0.1, group=g_grup10, tooltip="Normal hacimin bu katı üzerindeki hacimler anormal olarak kabul edilir")
i_siradisi_volatilite_carpan = input.float(2.0, "Volatilite Artış Çarpanı", minval=1.2, step=0.1, group=g_grup10, tooltip="Normal volatilitenin bu katı üzerindeki değerler anormal olarak kabul edilir")
// =================== VOLUME PROFILE VISIBLE RANGE AYARLAR ===================
g_grup_vpvr = "Volume Profile Ayarları"
i_vpvr_aktif = input.bool(false, "VPVR Göster", group=g_grup_vpvr, tooltip="Volume Profile Visible Range özelliğini etkinleştirir")
i_line_renk = input.color(color.new(color.gray, 25), "Üst/Alt Çizgi Rengi", group=g_grup_vpvr)
i_alis_bar_renk = input.color(color.new(color.green, 25), "Alış Bar Rengi", group=g_grup_vpvr)
i_satis_bar_renk = input.color(color.new(color.red, 25), "Satış Bar Rengi", group=g_grup_vpvr)
i_bar_sayisi = input.int(90, "Bar Sayısı", minval=14, maxval=365, group=g_grup_vpvr)
i_son_mumdan_mesafe = input.int(2, "Son Mumdan Mesafe", minval=2, maxval=20, group=g_grup_vpvr)
i_histogram_sayisi = input.int(50, "Histogram Sayısı", minval=10, maxval=200, group=g_grup_vpvr)
i_poc_genislik = input.int(50, "PoC Genişliği", minval=20, maxval=100, group=g_grup_vpvr)
// =================== FONKSİYONLAR ===================
isSwingHigh(index) =>
high > high and high > high and high > high and high > high
isSwingLow(index) =>
low < low and low < low and low < low and low < low
// Olası sinyal fonksiyonları
getOlasiAlisSinyali(curr_close, prev_close, maliyet) =>
result = false
if not na(maliyet)
fark_yuzde = math.abs((curr_close - maliyet) / maliyet * 100)
result := curr_close > prev_close and fark_yuzde <= i_olasi_sinyal_hassasiyeti
result
getOlasiSatisSinyali(curr_close, prev_close, maliyet) =>
result = false
if not na(maliyet)
fark_yuzde = math.abs((curr_close - maliyet) / maliyet * 100)
result := curr_close < prev_close and fark_yuzde <= i_olasi_sinyal_hassasiyeti
result
// Olası sinyal seviyelerini hesaplama fonksiyonları
getOlasiAlisSeviyesi(maliyet) =>
float sonuc = na
if not na(maliyet)
sonuc := maliyet * (1 - i_olasi_sinyal_hassasiyeti/100)
sonuc
getOlasiSatisSeviyesi(maliyet) =>
float sonuc = na
if not na(maliyet)
sonuc := maliyet * (1 + i_olasi_sinyal_hassasiyeti/100)
sonuc
// =================== TEKNİK GÖSTERGELER ===================
// RSI Hesaplama
rsi := ta.rsi(close, i_rsi_period)
rsi_deger := rsi
rsi_alis_kosul := i_rsi_aktif ? rsi < i_rsi_alt : true
rsi_satis_kosul := i_rsi_aktif ? rsi > i_rsi_ust : true
// Hacim Analizi
vol_sma := ta.sma(volume, i_hacim_period)
float yerel_hacim_orani = volume / vol_sma
hacim_orani := yerel_hacim_orani
yuksek_hacim := i_hacim_aktif ? yerel_hacim_orani > i_hacim_carpan : true
// Sıra dışı hareket hesaplamaları
volatilite := ta.atr(14)
volatilite_ort := ta.sma(volatilite, 20)
// Fiyat değişimi hesaplama
fiyat_degisim_yuzde := math.abs((close - close ) / close * 100)
// Sıra dışı hareket sinyalleri
siradisi_fiyat := fiyat_degisim_yuzde > i_siradisi_fiyat_yuzde
siradisi_hacim := hacim_orani > i_siradisi_hacim_carpan
siradisi_volatilite := volatilite > volatilite_ort * i_siradisi_volatilite_carpan
// Genel sıra dışı hareket tespiti (en az ikisi doğru olmalı)
siradisi_hareket := (siradisi_fiyat and siradisi_hacim) or (siradisi_fiyat and siradisi_volatilite) or (siradisi_hacim and siradisi_volatilite)
// Alış veya satış yönünü belirle
siradisi_alis := siradisi_hareket and close > open
siradisi_satis := siradisi_hareket and close < open
// =================== HESAPLAMALAR ===================
// Trend değişkenleri
yukselen_mumlar := close > open
dusen_mumlar := close < open
// =================== SWING HIGH/LOW HESABI ===================
// Swing High/Low hesaplama
swing_yuksek := ta.pivothigh(i_pivot_lookback, i_pivot_lookback)
swing_dusuk := ta.pivotlow(i_pivot_lookback, i_pivot_lookback)
// Son swing high/low güncelleme
if not na(swing_yuksek)
last_swing_high := swing_yuksek
if not na(swing_dusuk)
last_swing_low := swing_dusuk
// Trend belirleme
if not na(last_swing_high) and not na(last_swing_low)
if high > last_swing_high and not uptrend
uptrend := true
if low < last_swing_low and uptrend
uptrend := false
// =================== MALİYET HESABI ===================
// Maliyet değişkenleri daha önce tanımlandı
// Alış maliyeti hesaplama
if uptrend and not na(last_swing_low) and not na(last_swing_high)
fib_range = last_swing_high - last_swing_low
alis_maliyeti := last_swing_high - fib_range * i_fib_seviye
alis_maliyeti_alt := last_swing_high - fib_range * i_fib_alt
alis_maliyeti_ust := last_swing_high - fib_range * i_fib_ust
// Satış maliyeti hesaplama
if not uptrend and not na(last_swing_low) and not na(last_swing_high)
fib_range = last_swing_high - last_swing_low
satis_maliyeti := last_swing_low + fib_range * i_fib_seviye
satis_maliyeti_alt := last_swing_low + fib_range * i_fib_alt
satis_maliyeti_ust := last_swing_low + fib_range * i_fib_ust
// =================== POZİSYON YÖNETİMİ ===================
// Pozisyon değişkenleri zaten daha önce tanımlandı, tekrar etmiyoruz
// Stop ve hedef seviyeleri artık başlangıçta tanımlandığı için yeniden tanımlamıyoruz, sadece değer atıyoruz
alis_sl := na
alis_tp := na
satis_sl := na
satis_tp := na
if not na(alis_maliyeti)
alis_sl := alis_maliyeti * (1 - i_sl_yuzde/100)
alis_tp := alis_maliyeti * (1 + i_tp_yuzde/100)
if not na(satis_maliyeti)
satis_sl := satis_maliyeti * (1 + i_sl_yuzde/100)
satis_tp := satis_maliyeti * (1 - i_tp_yuzde/100)
// =================== SİNYAL HESAPLAMA ===================
var float last_signal_price = na
var int last_signal_type = 0 // 1 = alis, -1 = satis, 0 = sinyal yok
var string last_signal_time = na
var bool last_signal_success = false
var int win_count = 0
var int loss_count = 0
var int total_signals = 0
var string status_text = ""
var color status_color = color.gray
var float profit_pct = 0.0
var float loss_pct = 0.0
var float trail_level = na
// Alış ve satış sinyalleri
alis_crossover := ta.crossover(close, alis_maliyeti * (1 + i_alis_sinyal_seviyesi/100))
satis_crossunder := ta.crossunder(close, satis_maliyeti * (1 + i_satis_sinyal_seviyesi/100))
// Olası sinyal seviyeleri
olasi_alis_seviyesi := getOlasiAlisSeviyesi(alis_maliyeti)
olasi_satis_seviyesi := getOlasiSatisSeviyesi(satis_maliyeti)
// Sinyal koşulları
alis_kosul_1 := alis_crossover
satis_kosul_1 := satis_crossunder
// Sinyal filtreleme
alis_filtre := rsi_alis_kosul and yuksek_hacim
satis_filtre := rsi_satis_kosul and yuksek_hacim
// Ek sinyal kontrolü
alis_ek_kosul := i_sinyal_ters_yon ? last_signal_type <= 0 or not pozisyonda : true
satis_ek_kosul := i_sinyal_ters_yon ? last_signal_type >= 0 or not pozisyonda : true
alis_pozisyon_kosul := i_sinyal_pozisyon_kontrol ? not pozisyonda or not son_islem_alis : true
satis_pozisyon_kosul := i_sinyal_pozisyon_kontrol ? not pozisyonda or son_islem_alis : true
// Pozisyon-bazlı sinyal kısıtlaması (Bu kısıtlama her zaman aktif olacak)
pozisyon_kisitlama_alis := not (pozisyonda and son_islem_alis) // Zaten alis pozisyonundaysak yeni alis sinyali verme
pozisyon_kisitlama_satis := not (pozisyonda and not son_islem_alis) // Zaten satis pozisyonundaysak yeni satis sinyali verme
// Final sinyaller
alis_sinyal := alis_kosul_1 and alis_filtre and alis_ek_kosul and alis_pozisyon_kosul and pozisyon_kisitlama_alis
satis_sinyal := satis_kosul_1 and satis_filtre and satis_ek_kosul and satis_pozisyon_kosul and pozisyon_kisitlama_satis
// Olası sinyaller
olasi_alis := getOlasiAlisSinyali(close, close , alis_maliyeti) and not alis_yapildi and rsi_alis_kosul and not (pozisyonda and son_islem_alis)
olasi_satis := getOlasiSatisSinyali(close, close , satis_maliyeti) and not satis_yapildi and rsi_satis_kosul and not (pozisyonda and not son_islem_alis)
// Sinyal yönetimi
if alis_sinyal
total_signals := total_signals + 1
last_signal_type := 1
last_signal_price := close
last_signal_time := str.format("{0}", timeframe.period)
last_signal_success := false
pozisyonda := true
son_islem_alis := true
giris_fiyati := close
max_kar := 0.0
max_zarar := 0.0
trailing_stop_seviyesi := close * (1 - i_trailing_yuzde/100)
alis_yapildi := true
satis_yapildi := false
status_text := "Alış Sinyali - " + str.tostring(math.round(close, 2))
status_color := i_alis_renk
if satis_sinyal
total_signals := total_signals + 1
last_signal_type := -1
last_signal_price := close
last_signal_time := str.format("{0}", timeframe.period)
last_signal_success := false
pozisyonda := true
son_islem_alis := false
giris_fiyati := close
max_kar := 0.0
max_zarar := 0.0
trailing_stop_seviyesi := close * (1 + i_trailing_yuzde/100)
satis_yapildi := true
alis_yapildi := false
status_text := "Satış Sinyali - " + str.tostring(math.round(close, 2))
status_color := i_satis_renk
// Trailing Stop güncelleme
if i_trailing_stop and pozisyonda
if son_islem_alis
trail_level := close * (1 - i_trailing_yuzde/100)
trailing_stop_seviyesi := math.max(trailing_stop_seviyesi, trail_level)
else
trail_level := close * (1 + i_trailing_yuzde/100)
trailing_stop_seviyesi := math.min(trailing_stop_seviyesi, trail_level)
// TP/SL için crossover/crossunder hesaplamaları
// Calculate crossover/crossunder variables once per bar
alis_tp_crossover_check := ta.crossover(close, alis_tp)
alis_sl_crossunder_check := ta.crossunder(close, alis_sl)
satis_tp_crossunder_check := ta.crossunder(close, satis_tp)
satis_sl_crossover_check := ta.crossover(close, satis_sl)
trailing_stop_crossunder_check := i_trailing_stop and ta.crossunder(close, trailing_stop_seviyesi)
// Update global crossover/crossunder variables
alis_tp_crossover := alis_tp_crossover_check
satis_tp_crossunder := satis_tp_crossunder_check
alis_sl_crossunder := alis_sl_crossunder_check
satis_sl_crossover := satis_sl_crossover_check
trailing_stop_crossunder := trailing_stop_crossunder_check
// Pozisyon takibi
if pozisyonda
if son_islem_alis
curr_kar := (close - giris_fiyati) / giris_fiyati * 100
max_kar := math.max(max_kar, curr_kar)
max_zarar := math.min(max_zarar, curr_kar)
// TP veya SL - Use the check variables
if (alis_tp_crossover_check or (i_trailing_stop ? trailing_stop_crossunder_check : alis_sl_crossunder_check))
pozisyonda := false
alis_yapildi := false
last_signal_type := 0 // Pozisyondan çıkışta signal type'ı sıfırla
if close >= alis_tp
win_count := win_count + 1
last_signal_success := true
profit_pct := profit_pct + i_tp_yuzde
status_text := "Alış TP - Kar: " + str.tostring(math.round(i_tp_yuzde, 2)) + "%"
status_color := i_tp_renk
else
loss_count := loss_count + 1
last_signal_success := false
loss_pct := loss_pct + i_sl_yuzde
status_text := "Alış SL - Zarar: " + str.tostring(math.round(i_sl_yuzde, 2)) + "%"
status_color := i_sl_renk
else
curr_kar := (giris_fiyati - close) / giris_fiyati * 100
max_kar := math.max(max_kar, curr_kar)
max_zarar := math.min(max_zarar, curr_kar)
// TP veya SL
if (satis_tp_crossunder_check or (i_trailing_stop ? trailing_stop_crossunder_check : satis_sl_crossover_check))
pozisyonda := false
satis_yapildi := false
last_signal_type := 0 // Pozisyondan çıkışta signal type'ı sıfırla
if close <= satis_tp
win_count := win_count + 1
last_signal_success := true
profit_pct := profit_pct + i_tp_yuzde
status_text := "Satış TP - Kar: " + str.tostring(math.round(i_tp_yuzde, 2)) + "%"
status_color := i_tp_renk
else
loss_count := loss_count + 1
last_signal_success := false
loss_pct := loss_pct + i_sl_yuzde
status_text := "Satış SL - Zarar: " + str.tostring(math.round(i_sl_yuzde, 2)) + "%"
status_color := i_sl_renk
// =================== GÖRSEL ELEMANLARI ===================
// Maliyet çizgileri
plot(alis_maliyeti, "Alış Maliyeti", color=color.new(i_alis_renk, 0), linewidth=i_cizgi_kalinlik, style=plot.style_linebr)
plot(satis_maliyeti, "Satış Maliyeti", color=color.new(i_satis_renk, 0), linewidth=i_cizgi_kalinlik, style=plot.style_linebr)
// Alt ve üst maliyet seviyeleri
plot(alis_maliyeti_alt, "Alış Alt Seviye", color=color.new(i_alis_renk, 70), linewidth=1, style=plot.style_linebr)
plot(alis_maliyeti_ust, "Alış Üst Seviye", color=color.new(i_alis_renk, 70), linewidth=1, style=plot.style_linebr)
plot(satis_maliyeti_alt, "Satış Alt Seviye", color=color.new(i_satis_renk, 70), linewidth=1, style=plot.style_linebr)
plot(satis_maliyeti_ust, "Satış Üst Seviye", color=color.new(i_satis_renk, 70), linewidth=1, style=plot.style_linebr)
// Stop loss ve take profit çizgileri
plot(alis_sl, "Alış Stop Loss", color=color.new(i_sl_renk, 0), linewidth=i_sl_tp_kalinlik, style=plot.style_circles)
plot(alis_tp, "Alış Take Profit", color=color.new(i_tp_renk, 0), linewidth=i_sl_tp_kalinlik, style=plot.style_circles)
plot(satis_sl, "Satış Stop Loss", color=color.new(i_sl_renk, 0), linewidth=i_sl_tp_kalinlik, style=plot.style_circles)
plot(satis_tp, "Satış Take Profit", color=color.new(i_tp_renk, 0), linewidth=i_sl_tp_kalinlik, style=plot.style_circles)
// Trailing Stop çizgisi
plot(i_trailing_stop and pozisyonda ? trailing_stop_seviyesi : na, "Trailing Stop", color=color.new(i_sl_renk, 30), linewidth=1, style=plot.style_stepline)
// Ana sinyal okları
plotshape(alis_sinyal, "Alış Sinyali", style=shape.triangleup, location=location.belowbar, color=i_ok_renk_alis, size=size.normal)
plotshape(satis_sinyal, "Satış Sinyali", style=shape.triangledown, location=location.abovebar, color=i_ok_renk_satis, size=size.normal)
// Olası sinyal okları ve seviyeleri
plotshape(olasi_alis, "Olası Alış", style=shape.circle, location=location.belowbar, color=i_olasi_alis_renk, size=size.tiny)
plotshape(olasi_satis, "Olası Satış", style=shape.circle, location=location.abovebar, color=i_olasi_satis_renk, size=size.tiny)
// Sıra dışı hareket okları
plotshape(siradisi_alis, "Sıra Dışı Yükseliş", style=shape.diamond, location=location.belowbar, color=color.new(i_alis_renk, 0), size=size.large)
plotshape(siradisi_satis, "Sıra Dışı Düşüş", style=shape.diamond, location=location.abovebar, color=color.new(i_satis_renk, 0), size=size.large)
// =================== VOLUME PROFILE VISIBLE RANGE ===================
// VPVR Hesaplama ve Çizim
if barstate.islast
// Sadece son barda VPVR hesaplamaları yap
if i_vpvr_aktif
// VPVR aktif ise
// Değişkenleri tanımla
float aralik_ust = ta.highest(high, i_bar_sayisi)
float aralik_alt = ta.lowest(low, i_bar_sayisi)
float aralik_yukseklik = aralik_ust - aralik_alt
float poc_fiyat_temp = na
float histogram_yukseklik = aralik_yukseklik / i_histogram_sayisi
// Histogram dizilerini yeniden ayarla
array.clear(vpvr_histogram_alt_liste)
array.clear(vpvr_histogram_ust_liste)
array.clear(vpvr_histogram_fiyat_liste)
array.clear(vpvr_histogram_alim_hacmi_liste)
array.clear(vpvr_histogram_satim_hacmi_liste)
array.clear(vpvr_histogram_hacim_yuzde_liste)
// Histogram dizilerini doldur
for i = 0 to i_histogram_sayisi - 1
float histogram_alt = aralik_alt + histogram_yukseklik * i
float histogram_ust = aralik_alt + histogram_yukseklik * (i + 1)
array.push(vpvr_histogram_alt_liste, histogram_alt)
array.push(vpvr_histogram_ust_liste, histogram_ust)
array.push(vpvr_histogram_fiyat_liste, (histogram_alt + histogram_ust) / 2)
array.push(vpvr_histogram_alim_hacmi_liste, 0.0)
array.push(vpvr_histogram_satim_hacmi_liste, 0.0)
array.push(vpvr_histogram_hacim_yuzde_liste, 0.0)
// Bar'ların hacimlerini histogramlara ata
for i = 0 to i_bar_sayisi - 1
float mevcut_bar_yukseklik = high - low
if mevcut_bar_yukseklik > 0
float mevcut_alim_hacmi = volume * (close - low ) / mevcut_bar_yukseklik
float mevcut_satim_hacmi = volume * (high - close ) / mevcut_bar_yukseklik
// Mevcut hacim yüzdesini histogramlara dağıt
for j = 0 to i_histogram_sayisi - 1
if j < array.size(vpvr_histogram_alt_liste) and j < array.size(vpvr_histogram_ust_liste)
float h_alt = array.get(vpvr_histogram_alt_liste, j)
float h_ust = array.get(vpvr_histogram_ust_liste, j)
// Bar ve histogram arasındaki kesişim hesapla
float hedef = math.max(h_ust, high ) - math.min(h_alt, low )
- math.max(0, math.max(h_ust, high ) - math.min(h_ust, high ))
- math.max(0, math.max(h_alt, low ) - math.min(h_alt, low ))
float hacim_yuzde = hedef / mevcut_bar_yukseklik
if hacim_yuzde > 0
float h_alim = array.get(vpvr_histogram_alim_hacmi_liste, j)
float h_satim = array.get(vpvr_histogram_satim_hacmi_liste, j)
array.set(vpvr_histogram_alim_hacmi_liste, j, h_alim + mevcut_alim_hacmi * hacim_yuzde)
array.set(vpvr_histogram_satim_hacmi_liste, j, h_satim + mevcut_satim_hacmi * hacim_yuzde)
// En yüksek hacimli histogramı bul (POC - Point of Control)
float en_yuksek_hacim = 0.0
for i = 0 to i_histogram_sayisi - 1
if i < array.size(vpvr_histogram_alim_hacmi_liste) and i < array.size(vpvr_histogram_satim_hacmi_liste)
float h_alim = array.get(vpvr_histogram_alim_hacmi_liste, i)
float h_satim = array.get(vpvr_histogram_satim_hacmi_liste, i)
float h_toplam = h_alim + h_satim
if h_toplam > en_yuksek_hacim
en_yuksek_hacim := h_toplam
poc_fiyat_temp := array.get(vpvr_histogram_fiyat_liste, i)
// POC değerlerini güncelle
vpvr_poc_fiyat := poc_fiyat_temp
vpvr_poc_hacim := en_yuksek_hacim
if not na(vpvr_poc_fiyat)
vpvr_poc_yuzde := (close - vpvr_poc_fiyat) / vpvr_poc_fiyat * 100
// Kapanış fiyatı POC'un üzerinde mi kontrol et
vpvr_ustunde := close > vpvr_poc_fiyat
// POC metni ve rengini ayarla
if vpvr_poc_yuzde > 0
vpvr_poc_renk := color.green
vpvr_poc_metin := str.tostring(vpvr_poc_fiyat, "#.00") + " ↑"
else
vpvr_poc_renk := color.red
vpvr_poc_metin := str.tostring(vpvr_poc_fiyat, "#.00") + " ↓"
// Önceki kutuları ve çizgileri temizle
if array.size(vpvr_alim_kutulari) > 0
for i = 0 to array.size(vpvr_alim_kutulari) - 1
box.delete(array.get(vpvr_alim_kutulari, i))
if array.size(vpvr_satim_kutulari) > 0
for i = 0 to array.size(vpvr_satim_kutulari) - 1
box.delete(array.get(vpvr_satim_kutulari, i))
if array.size(vpvr_cizgiler) > 0
for i = 0 to array.size(vpvr_cizgiler) - 1
line.delete(array.get(vpvr_cizgiler, i))
array.clear(vpvr_alim_kutulari)
array.clear(vpvr_satim_kutulari)
array.clear(vpvr_cizgiler)
// Aralık üst ve alt sınırlarını çiz
int zaman_birimi = int(time - time )
line ust_cizgi = line.new(time , aralik_ust, time + i_son_mumdan_mesafe * zaman_birimi, aralik_ust,
xloc=xloc.bar_time, color=i_line_renk, width=2)
line alt_cizgi = line.new(time , aralik_alt, time + i_son_mumdan_mesafe * zaman_birimi, aralik_alt,
xloc=xloc.bar_time, color=i_line_renk, width=2)
// Çizgileri diziye ekle
array.push(vpvr_cizgiler, ust_cizgi)
array.push(vpvr_cizgiler, alt_cizgi)
// Histogramları çiz
// Önce maksimum hacmi bul
float max_hacim = en_yuksek_hacim
if max_hacim > 0
for i = 0 to i_histogram_sayisi - 1
if i < array.size(vpvr_histogram_alt_liste) and i < array.size(vpvr_histogram_ust_liste) and i < array.size(vpvr_histogram_alim_hacmi_liste) and i < array.size(vpvr_histogram_satim_hacmi_liste)
float h_alt = array.get(vpvr_histogram_alt_liste, i)
float h_ust = array.get(vpvr_histogram_ust_liste, i)
float h_alim = array.get(vpvr_histogram_alim_hacmi_liste, i)
float h_satim = array.get(vpvr_histogram_satim_hacmi_liste, i)
float h_toplam = h_alim + h_satim
if h_toplam > 0
float genislik = i_poc_genislik * h_toplam / max_hacim
float alim_genislik = math.floor(genislik * h_alim / h_toplam)
float satim_genislik = math.floor(genislik * h_satim / h_toplam)
// Alım ve satım histogramlarını çiz
if alim_genislik > 0
box alim_kutu = box.new( left=int(bar_index + i_son_mumdan_mesafe), top=h_ust, right=int(bar_index + i_son_mumdan_mesafe + alim_genislik), bottom=h_alt, bgcolor=i_alis_bar_renk, border_color=color.new(color.black, 80))
array.push(vpvr_alim_kutulari, alim_kutu)
if satim_genislik > 0
box satim_kutu = box.new( left=int(bar_index + i_son_mumdan_mesafe + alim_genislik), top=h_ust, right=int(bar_index + i_son_mumdan_mesafe + alim_genislik + satim_genislik), bottom=h_alt, bgcolor=i_satis_bar_renk, border_color=color.new(color.black, 80))
array.push(vpvr_satim_kutulari, satim_kutu)
else
// VPVR aktif değilse tüm görsel nesneleri temizle
// Kutuları temizle
if array.size(vpvr_alim_kutulari) > 0
for i = 0 to array.size(vpvr_alim_kutulari) - 1
box.delete(array.get(vpvr_alim_kutulari, i))
if array.size(vpvr_satim_kutulari) > 0
for i = 0 to array.size(vpvr_satim_kutulari) - 1
box.delete(array.get(vpvr_satim_kutulari, i))
// Çizgileri temizle
if array.size(vpvr_cizgiler) > 0
for i = 0 to array.size(vpvr_cizgiler) - 1
line.delete(array.get(vpvr_cizgiler, i))
// Dizileri temizle
array.clear(vpvr_alim_kutulari)
array.clear(vpvr_satim_kutulari)
array.clear(vpvr_cizgiler)
// VPVR POC (Point of Control) Bilgisi
if barstate.islast
if i_vpvr_aktif
// VPVR aktifse POC bilgilerini göster
table.cell(table_obj, 0, 19, "VPVR POC:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 19, vpvr_poc_metin, text_color=vpvr_poc_renk, text_size=size.small, bgcolor=i_panel_renk)
if not na(vpvr_poc_yuzde)
table.cell(table_obj, 0, 20, "POC'ye Mesafe (%):", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 20, str.tostring(vpvr_poc_yuzde, "#.##") + "%",
text_color=vpvr_poc_yuzde >= 0 ? color.green : color.red,
text_size=size.small,
bgcolor=i_panel_renk)
// POC'un üstünde mi altında mı bilgisi
table.cell(table_obj, 0, 21, "POC Durumu:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 21, vpvr_ustunde ? "POC Üzerinde ↑" : "POC Altında ↓",
text_color=vpvr_ustunde ? color.green : color.red,
text_size=size.small,
bgcolor=i_panel_renk)
else
table.cell(table_obj, 0, 20, "POC'ye Mesafe (%):", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 20, "HESAPLANIYOR", text_color=i_panel_yazi_renk, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 21, "POC Durumu:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 21, "HESAPLANIYOR", text_color=i_panel_yazi_renk, text_size=size.small, bgcolor=i_panel_renk)
else
// VPVR aktif değilse boş hücreler göster
table.cell(table_obj, 0, 19, "", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 19, "", text_color=i_panel_yazi_renk, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 20, "", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 20, "", text_color=i_panel_yazi_renk, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 21, "", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 21, "", text_color=i_panel_yazi_renk, text_size=size.small, bgcolor=i_panel_renk)
// =================== PANEL ===================
// Panel pozisyonunu ayarla
var panel_pos = i_panel_konum == "Sag Üst" ? position.top_right :
i_panel_konum == "Sol Üst" ? position.top_left :
i_panel_konum == "Sag Alt" ? position.bottom_right : position.bottom_left
// Renk ayarları
var panel_bg_renk = i_panel_renk
var panel_text_renk = color.white
var alim_renk = i_alis_renk
var satim_renk = i_satis_renk
// Tablo oluştur
table_obj := table.new(panel_pos, 2, 22, i_panel_renk, frame_width=2, frame_color=panel_text_renk, border_color=panel_text_renk, border_width=1)
// Maliyet referansları için formatlama fonksiyonu
f_renk_format(deger, ref_alt, ref_ust) =>
deger < ref_alt ? satim_renk : deger > ref_ust ? alim_renk : panel_text_renk
// Tablo başlığı
f_tablo_guncelle(table_obj) =>
table.cell(table_obj, 0, 0, "Spekulator Maliyet Analizi Pro V4", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 0, "v4.1", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
// Piyasa bilgileri
table.cell(table_obj, 0, 1, "PİYASA BİLGİLERİ", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 1, "", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 2, "Trend:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
trend_durum = uptrend ? 1 : -1
trend_renk = trend_durum == 1 ? alim_renk : satim_renk
trend_metin = trend_durum == 1 ? "YUKARI (Alış)" : "AŞAĞI (Satış)"
table.cell(table_obj, 1, 2, trend_metin, text_color=trend_renk, text_size=size.small, bgcolor=i_panel_renk)
// Maliyet bilgileri
table.cell(table_obj, 0, 3, "MALİYET HESABI", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 3, "", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 4, "Kritik Fib. 61.8%:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 4, str.tostring(alis_maliyeti, "#.00"), text_color=f_renk_format(close, alis_maliyeti * 0.99, alis_maliyeti * 1.01), text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 5, "Kritik Fib. 78.6%:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 5, str.tostring(satis_maliyeti, "#.00"), text_color=f_renk_format(close, satis_maliyeti * 0.99, satis_maliyeti * 1.01), text_size=size.small, bgcolor=i_panel_renk)
// Diğer maliyet bilgileri...
table.cell(table_obj, 0, 6, "TE Maliyet (ORT):", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 6, str.tostring(alis_maliyeti, "#.00"), text_color=f_renk_format(close, alis_maliyeti * 0.99, alis_maliyeti * 1.01), text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 7, "TE Min. Maliyet:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 7, str.tostring(alis_maliyeti_alt, "#.00"), text_color=f_renk_format(close, alis_maliyeti_alt * 0.99, alis_maliyeti_alt * 1.01), text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 8, "TE Maks. Maliyet:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 8, str.tostring(alis_maliyeti_ust, "#.00"), text_color=f_renk_format(close, alis_maliyeti_ust * 0.99, alis_maliyeti_ust * 1.01), text_size=size.small, bgcolor=i_panel_renk)
// Pozisyon durumu
table.cell(table_obj, 0, 9, "POZİSYON DURUMU", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 9, "", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
var int son_trend_yonu = 0
var int son_trend_uzunlugu = 0
if close > open
if son_trend_yonu == 1
son_trend_uzunlugu := son_trend_uzunlugu + 1
else
son_trend_yonu := 1
son_trend_uzunlugu := 1
else if close < open
if son_trend_yonu == -1
son_trend_uzunlugu := son_trend_uzunlugu + 1
else
son_trend_yonu := -1
son_trend_uzunlugu := 1
pos_durum_renk = pozisyonda ? (son_islem_alis ? alim_renk : satim_renk) : panel_text_renk
pos_durum_metin = pozisyonda ? (son_islem_alis ? "UZUN (Alış)" : "KISA (Satış)") : "POZİSYON YOK"
table.cell(table_obj, 0, 10, "Mevcut Pozisyon:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 10, pos_durum_metin, text_color=pos_durum_renk, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 11, "Sinyal Tipi:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
sinyal_renk = last_signal_type == 1 ? alim_renk : last_signal_type == -1 ? satim_renk : panel_text_renk
sinyal_metin = last_signal_type == 1 ? "ALIS" : last_signal_type == -1 ? "SATIŞ" : "YOK"
table.cell(table_obj, 1, 11, sinyal_metin, text_color=sinyal_renk, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 12, "Olası Sinyal:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
olasi_sinyal_renk = olasi_alis ? alim_renk : olasi_satis ? satim_renk : panel_text_renk
olasi_sinyal_metin = olasi_alis ? "OLASI ALIS" : olasi_satis ? "OLASI SATIŞ" : "YOK"
table.cell(table_obj, 1, 12, olasi_sinyal_metin, text_color=olasi_sinyal_renk, text_size=size.small, bgcolor=i_panel_renk)
// Hacim ve volatilite
table.cell(table_obj, 0, 13, "DESTEKLEYEN FAKTÖRLER", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 13, "", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
// RSI
rsi_renk = rsi < 30 ? alim_renk : rsi > 70 ? satim_renk : panel_text_renk
table.cell(table_obj, 0, 14, "RSI Değeri:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 14, str.tostring(rsi, "#.00"), text_color=rsi_renk, text_size=size.small, bgcolor=i_panel_renk)
// Hacim Durumu
float yerel_hacim_orani = volume / vol_sma
hacim_renk = yerel_hacim_orani > 1.1 ? alim_renk : yerel_hacim_orani < 0.9 ? satim_renk : panel_text_renk
table.cell(table_obj, 0, 15, "Hacim Oranı:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 15, str.tostring(yerel_hacim_orani, "#.00x"), text_color=hacim_renk, text_size=size.small, bgcolor=i_panel_renk)
// Mevcut Aralık
fiyat_araligi = (high - low) / low * 100
aralik_renk = fiyat_araligi > 1.5 ? alim_renk : panel_text_renk
table.cell(table_obj, 0, 16, "Fiyat Aralığı (%):", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 16, str.tostring(fiyat_araligi, "#.00") + "%", text_color=aralik_renk, text_size=size.small, bgcolor=i_panel_renk)
// Ardışık Mum Sayısı
mum_renk = son_trend_yonu == 1 ? alim_renk : son_trend_yonu == -1 ? satim_renk : panel_text_renk
mum_metin = son_trend_yonu == 1 ? "+" + str.tostring(son_trend_uzunlugu) + " YEŞİL" : son_trend_yonu == -1 ? "-" + str.tostring(son_trend_uzunlugu) + " KIRMIZI" : "NÖTR"
table.cell(table_obj, 0, 17, "Ardışık Mumlar:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 17, mum_metin, text_color=mum_renk, text_size=size.small, bgcolor=i_panel_renk)
// Anormal Hareket Uyarısı
var int siradisi_durumlar = 0
siradisi_durumlar := siradisi_alis or siradisi_satis ? siradisi_durumlar + 1 : siradisi_durumlar
siradisi_renk = siradisi_durumlar > 0 ? color.yellow : panel_text_renk
siradisi_metin = siradisi_durumlar > 0 ? "Sıra Dışı İşaret" : "NORMAL"
table.cell(table_obj, 0, 18, "Sıra Dışı Durum:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 18, siradisi_metin, text_color=siradisi_renk, text_size=size.small, bgcolor=i_panel_renk)
// Panel'i güncelle
if barstate.islast
f_tablo_guncelle(table_obj)
// =================== ALERTLER ===================
alertcondition(alis_sinyal, "Alış Sinyali", "Fiyat alış maliyetini yukarı kırdı")
alertcondition(satis_sinyal, "Satış Sinyali", "Fiyat satış maliyetini aşağı kırdı")
alertcondition(alis_tp_crossover, "Alış TP", "Alış pozisyonu kar hedefine ulaştı")
alertcondition(satis_tp_crossunder, "Satış TP", "Satış pozisyonu kar hedefine ulaştı")
alertcondition(alis_sl_crossunder, "Alış SL", "Alış pozisyonu stop loss seviyesinde")
alertcondition(satis_sl_crossover, "Satış SL", "Satış pozisyonu stop loss seviyesinde")
alertcondition(trailing_stop_crossunder, "Trailing Stop", "Trailing stop seviyesine ulaşıldı")
alertcondition(olasi_alis, "Olası Alış", "Olası alış fırsatı")
alertcondition(olasi_satis, "Olası Satış", "Olası satış fırsatı")
// Sıra dışı hareket alertleri
alertcondition(siradisi_alis, "Sıra Dışı Yükseliş", "Anormal derecede hızlı bir yükseliş tespit edildi!")
alertcondition(siradisi_satis, "Sıra Dışı Düşüş", "Anormal derecede hızlı bir düşüş tespit edildi!")
Gold Trading Bot with Robust Risk ManagementMarket Focus:
The script is now clearly labeled for gold trading. When using it, load a gold chart (such as XAUUSD) on TradingView.
Risk Management:
It uses an ATR-based stop loss and take profit mechanism. The stop loss and take profit distances adjust dynamically with market volatility, which is particularly useful in the sometimes volatile gold market.
Strategy Logic:
A simple moving average crossover triggers a long position. This example is a starting point; you might want to experiment with different indicators or add short conditions depending on your approach.
Customization:
While the default values (e.g., ATR period, multipliers, MA lengths) provide a solid foundation, consider optimizing these settings through backtesting specifically for gold to match its price dynamics.
Multi-Timeframe Strategy with Time FiltersLooks at overall trend on 15 minute timeframe and identifies candlestick types on 1 minute time frame to determine entry. Does not execute trades too close to market open or close and doesn't hold any trades past the end of trading day.
9 & 15 EMA + ADX Strategy**📌 9 & 15 EMA + ADX Strategy | Trend-Following Trading System**
This script is a **highly effective trend-following strategy** that combines **Exponential Moving Averages (9 EMA & 15 EMA)** with **ADX (Average Directional Index)** to filter out weak trends and improve accuracy.
🔹 **How it Works:**
✅ A **Buy Signal** is generated when:
- The price **closes above 9 EMA** and is also above 15 EMA.
- **ADX is greater than 20**, confirming a strong trend.
✅ A **Sell Signal** is generated when:
- The price **closes below 9 EMA** and is also below 15 EMA.
- **ADX is greater than 20**, confirming bearish strength.
🎯 **Best Use Cases:**
- Works well for **Forex, Crypto, Stocks, and Indices**.
- Optimized for **Scalping, Intraday, and Swing Trading**.
- Effective on **5min, 15min, 1H, and 4H timeframes**.
📊 **Features:**
✔️ **Filters out false breakouts** using ADX confirmation.
✔️ **Backtest-ready** with TradingView's Strategy Tester.
✔️ **Fully customizable parameters** for different market conditions.
✔️ Can be used alongside **Support & Resistance levels** for better accuracy.
🚀 **Try it now and enhance your trading strategy!**
Elliott Wave DetectorDưới đây là một bot Pine Script giúp nhận diện sóng Elliott cơ bản trên TradingView. Nó xác định điểm bắt đầu của sóng 1 và hiển thị các mức TP/SL dựa trên Fibonacci.
Ultimate Scalping Strategy - Enhancedltra-Clean Scalping Strategy + Enhanced RSI Box
This is a high-performance scalping strategy designed for 1-minute to 5-minute charts, with a focus on maximizing profitability and reducing false signals. It combines a series of advanced technical indicators to provide clean, actionable buy and sell signals for quick and efficient trading.
Key Features:
EMA Setup (Fast, Medium, Slow): Utilizes multiple EMAs to track the trend and identify optimal entry points.
RSI (Relative Strength Index): Includes an enhanced RSI box that visually displays the current RSI, with color-coding indicating overbought or oversold conditions.
MACD (Moving Average Convergence Divergence): Integrates the MACD for additional trend confirmation and helps filter out weaker signals.
Volume Filter: Filters trades based on volume spikes, ensuring that trades are supported by increased market activity.
Clean and Simple UI: The strategy provides clear buy and sell signals, along with a floating RSI box for quick reference.
Optimized for Scalping: Perfect for quick, short-term trades, maximizing profits while minimizing false signals.
Trade Logic:
Long Signal (Buy): Generated when the fast EMA crosses above the medium EMA, the price is above the slow EMA, RSI is under the overbought level, MACD is bullish, and volume spikes.
Short Signal (Sell): Generated when the fast EMA crosses below the medium EMA, the price is below the slow EMA, RSI is above the oversold level, MACD is bearish, and volume spikes.
Alerts: Set alerts for both buy and sell conditions to never miss a high-probability trade.
hammer and inverted hammer مؤشر المطرقة والمطرقة المقلوبةthis script show only hammer and inverted hammer candle sticks with H for hammer and IH for inverted hammer it will identify hammer and inverted hammer only with certin conditions to filter noise
My Buy Signal Strategy"My Buy Signal Strategy", teknik analiz göstergeleri ve mum formasyonlarını birleştirerek piyasada alım fırsatlarını tespit etmeyi amaçlayan esnek ve özelleştirilebilir bir stratejidir. 9 koşuluyla, kullanıcıların ihtiyaçlarına göre uyarlanabilir ve TradingView üzerinde kolayca test edilebilir. Strateji, hem trend takip hem de dönüş sinyallerini yakalamak için dengeli bir yaklaşım sunar.
My Buy Signal Strategy"Hugo v.1.0", teknik analiz göstergeleri ve mum formasyonlarını birleştirerek piyasada alım fırsatlarını tespit etmeyi amaçlayan esnek ve özelleştirilebilir bir stratejidir. 9 koşuluyla, kullanıcıların ihtiyaçlarına göre uyarlanabilir ve TradingView üzerinde kolayca test edilebilir. Strateji, hem trend takip hem de dönüş sinyallerini yakalamak için dengeli bir yaklaşım sunar.
Mercúrio RetrógradoWelcome to the cosmic world of Mercury Retrograde! 🌠 This indicator on TradingView is designed to mark the periods when the planet Mercury goes into retrograde, bringing with it a touch of introspection, revision, and of course, challenges in communication, technology, and travel. 🚀
Between 2025 and 2030, whenever Mercury begins its retrograde, you'll see a red background on the chart, signaling these astrological periods that could influence the market and your personal journey. 🌑
🔴 What is Mercury Retrograde? It's an astrological phenomenon that occurs when Mercury appears to move backward in the sky. This motion can create a feeling of slowdown and confusion but is also a time for reflection and reassessment.