hoang tu Trend Indicatorthực nghiệm ngày 7/3/2025
hãy thử kiểm tra mua khi giá trị kiểm tra từ 0 lên 7%, mua tốt nhất quanh giá trị 10%
Candlestick analysis
Heikin-Ashi Reversals with Region & DotsIf you want to use Heiken Ashi candles as a way to screen for bullish and bearish reversal.
Green background is stay long and strong. Red background = potential top or bearish continuation.
Yellow dots show strong red heiken ashi candles with small upside wicks. The next candle determines whether it should be green or red. If next heiken ashi candle closes above the current candle = green, bull trend still in line. If next heiken ashi candle closes below, then time to sell
Sniper Trade Pro (ES 15-Min) - Topstep Optimized🔹 Overview
Sniper Trade Pro is an advanced algorithmic trading strategy designed specifically for E-mini S&P 500 (ES) Futures on the 15-minute timeframe. This strategy is optimized for Topstep 50K evaluations, incorporating strict risk management to comply with their max $1,000 daily loss limit while maintaining a high probability of success.
It uses a multi-confirmation approach, integrating:
✅ Money Flow Divergence (MFD) → To track liquidity imbalances and institutional accumulation/distribution.
✅ Trend Confirmation (EMA + VWAP) → To identify strong trend direction and avoid choppy markets.
✅ ADX Strength Filter → To ensure entries only occur in trending conditions, avoiding weak setups.
✅ Break-Even & Dynamic Stop-Losses → To reduce drawdowns and protect profits dynamically.
This script automatically generates Buy and Sell signals and provides built-in risk management for automated trading execution through TradingView Webhooks.
🔹 How Does This Strategy Work?
📌 1. Trend Confirmation (EMA + VWAP)
The strategy uses:
✔ 9-EMA & 21-EMA: Fast-moving averages to detect short-term momentum.
✔ VWAP (Volume-Weighted Average Price): Ensures trades align with institutional volume flow.
How it works:
Bullish Condition: 9-EMA above 21-EMA AND price above VWAP → Confirms buy trend.
Bearish Condition: 9-EMA below 21-EMA AND price below VWAP → Confirms sell trend.
📌 2. Liquidity & Money Flow Divergence (MFD)
This indicator measures liquidity shifts by tracking momentum changes in price and volume.
✔ MFD Calculation:
Uses Exponential Moving Average (EMA) of Momentum (MOM) to detect changes in buying/selling pressure.
If MFD is above its moving average, it signals liquidity inflows → bullish strength.
If MFD is below its moving average, it signals liquidity outflows → bearish weakness.
Why is this important?
Detects when Smart Money is accumulating or distributing before major moves.
Filters out false breakouts by confirming momentum strength before entry.
📌 3. Trade Entry Triggers (Candlestick Patterns & ADX Filter)
To avoid random entries, the strategy waits for specific candlestick confirmations with ADX trend strength:
✔ Bullish Entry (Buy Signal) → Requires:
Bullish Engulfing Candle (Reversal confirmation)
ADX > 20 (Ensures strong trending conditions)
MFD above its moving average (Liquidity inflows)
9-EMA > 21-EMA & price above VWAP (Trend confirmation)
✔ Bearish Entry (Sell Signal) → Requires:
Bearish Engulfing Candle (Reversal confirmation)
ADX > 20 (Ensures strong trending conditions)
MFD below its moving average (Liquidity outflows)
9-EMA < 21-EMA & price below VWAP (Trend confirmation)
📌 4. Risk Management & Profit Protection
This strategy is built with strict risk management to maintain low drawdowns and maximize profits:
✔ Dynamic Position Sizing → Automatically adjusts trade size to risk a fixed $400 per trade.
✔ Adaptive Stop-Losses → Uses ATR-based stop-loss (0.8x ATR) to adapt to market volatility.
✔ Take-Profit Targets → Fixed at 2x ATR for a Risk:Reward ratio of 2:1.
✔ Break-Even Protection → Moves stop-loss to entry once price moves 1x ATR in profit, locking in gains.
✔ Max Daily Loss Limit (-$1,000) → Stops trading if total losses exceed $1,000, complying with Topstep rules.
Customizable EMA StrategyThis strategy gives the best results when there is a trend. It can be used in all timeframes, but especially in the 1-minute and 5-minute timeframes when the market is trending, make sure to use it during the London or New York sessions. Whenever the price breaks the 200 Moving Average for the first time and moves away from it, on the retracement when it hits the 50 Moving Average up to 2 times, if a signal is generated, you can take the trade. The same applies for the 100 Moving Average. Don’t forget, do not use it in ranging markets.
KP LevelsLevels indicator for Killpips. Includes daily and weekly input boxes. Ability to select color for each level and adjust line size + label size.
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.
TIMEFRAME HIGHLIGHTERThis is tool is not an indicator , it is simply a "hand of help" so that we dont waste any time marking periods with Vertical Trendlines . It is a timeframe highlighter which is marking based on the day you select , along with the specific Hour and Minute you want to be highlighted . So that we may win some time and get things done faster , better and more accurate .
(Please do not share or republish this tool AS YOUR OWN , in any other case where you want to adjust it or change there is not an ISSUE , AS LONG AS MY NAME IT IS INCLUDED AND REFERRED AS THE CREATOR OF THE ORIGINAL VERSION . )
Enjoy !
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
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.
Wick Order IndicatorThe script tells you what formed first in the wick, the high or the low.
If the high formed first, the upper wick would be labeled 1 and lower wick would be labeled 2.
If the low formed first, the lower wick would be labeled 1 and higher wick would be labeled 2.
If there's only one wick or no wicks, there would be no labels.
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.
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 =====
Remove Gaps (Superimposed)This to delete the gap, is to delete all gap that show the graph when it starts with a a gap
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.
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
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).
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.
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.