[GYTS] Ultimate Smoother (3-poles + 2 poles)Ultimate Smoother (3-pole)
🌸 Part of GoemonYae Trading System (GYTS) 🌸
🌸 --------- INTRODUCTION --------- 🌸
💮 Release of 3-Pole Ultimate Smoother
This indicator presents a new 3-pole version of John Ehlers' Ultimate Smoother (2024) . This results in an unconventional filter that exhibits effectively zero lag in practical trading applications, regardless of the set period. By using a 2-pole high-pass filter in its design, it responds to price direction changes on the same bar, while still allowing the user to control smoothness.
💮 What is the Ultimate Smoother?
The original Ultimate Smoother is a revolutionary filter designed by John Ehlers (2024) that smooths price data with virtually zero lag in the pass band. While conventional filters always introduce lag when removing market noise, the Ultimate Smoother maintains phase alignment at low frequencies while still providing excellent noise reduction.
💮 Mathematical Foundation
The Ultimate Smoother achieves its remarkable properties through a clever mathematical approach:
1. Instead of directly designing a low-pass filter (like traditional moving averages), it subtracts a high-pass filter from an all-pass filter (the original input data).
2. At very low frequencies, the high-pass filter contributes almost nothing, so the output closely matches the input in both amplitude and phase.
3. At higher frequencies, the high-pass filter's response increasingly matches the input data, resulting in cancellation through subtraction.
The 3-pole version extends this principle by using a higher-order high-pass filter, requiring additional coefficients and handling more terms in the numerator of the transfer function.
🌸 --------- USAGE GUIDE --------- 🌸
💮 Period Parameter Behaviour
The period parameter in the 3-pole Ultimate Smoother works somewhat counterintuitively:
- Longer periods: Result in less smooth, but more responsive following of the price. The filter output more closely tracks the input data.
- Shorter periods: Produce smoother output but may exhibit overshooting (extrapolating price movement) for larger movements.
This is different from most filters where longer periods typically produce smoother outputs with more lag.
💮 When to Choose 3-Pole vs. 2-Pole
- Choose the 3-pole version when you need zero-lag but want to control the smoothness
- Choose the 2-pole version when you are okay with some lag with the benefit of more smoothness.
🌸 --------- ACKNOWLEDGEMENTS --------- 🌸
This indicator builds upon the pioneering work of John Ehlers, particularly from his article April 2024 edition of TASC's Traders' Tips . The original version is published on TradingView by @PineCodersTASC .
This 3-pole extension was developed by @GoemonYae . Feedback is highly appreciated!
지표 및 전략
UT Bot Alerts – Time Filtered with ExitsThis indicator combines several technical approaches to generate precise entry and exit signals, while incorporating time filters that ensure signals are sent only during desired time windows and with defined cooldown periods. It is based on the original idea by QuantNomad.
Main Components:
ATR-based Trailing Stop:
Using the Average True Range (ATR) and an adjustable multiplier ("Key Value"), a dynamic trailing stop is calculated that adapts to the current price. This trailing stop forms the basis for the signal generation.
EMA-based Entry Signals:
A very short exponential moving average (EMA, period 1) is used in combination with the trailing stop to identify clear buy (long) and sell (short) signals via crossovers. An additional buffer zone helps reduce false signals.
Persistent Trade State:
The current state (long, short, or neutral) is maintained so that the system remains in the trend until a new signal is generated.
Linear Regression as Reference:
A linear regression line computed over a defined period serves as a reference for determining exit levels.
Exit Signals with Delay:
Exit signals are generated when the price deviates from the linear regression line by a defined percentage (Exit Signal Deviation) and the condition persists for at least a specified number of bars (Exit Signal Delay). Only one exit signal is issued per trade to avoid excessive exits.
Time Filters and Cooldown:
Session Filter: A user-defined session (e.g., "2200-0500") can disable signals during specified periods.
Cooldown Period: After a signal is triggered, a cooldown phase (in minutes) can be set during which no new signals are sent.
Visual Display and Alerts:
Entry Signals: Buy and sell signals are displayed as labels (green for long, red for short).
Exit Signals: Exit signals appear as triangles, with the exit long signal text displayed in white.
Reference Lines:
The upper exit level (Exit Short Level) is drawn as a solid line in turquoise (color.aqua).
The lower exit level (Exit Long Level) is drawn as a solid line in yellow.
Additionally, the ATR trailing stop and the linear regression line are clearly plotted on the chart.
Alerts can be configured for all signal types.
In Summary:
The indicator delivers precise entry signals based on an ATR trailing stop and a short EMA, supplemented by dynamic exit levels determined via linear regression. With integrated time filters (session and cooldown) and a flexible exit mechanism, this indicator offers controlled trade management—ideal for traders who wish to receive signals only during desired time periods.
Original Author: QuantNomad
RSI INPROFIT StrategyEstrategia basada en RSI compra en niveles de sobre venta y vende en niveles de sobre compra. Hay que optimizarla usando filtro de tendencias MTF EMA 50 y EMA200. Si alguien sabe como hacerlo, bienvenida la ayuda. Saludos.-
FinFluential Global M2 Money Supply // Days Offset =The "Global M2 Money Supply" indicator calculates and visualizes the combined M2 money supply from multiple countries and regions worldwide, expressed in trillions of USD.
M2 is a measure of the money supply that includes cash, checking deposits, and easily convertible near-money assets. This indicator aggregates daily M2 data from various economies, converts them into a common USD base using forex exchange rates, and plots the total as a single line on the chart.
It is designed as an overlay indicator aligned to the right scale, making it ideal for comparing global money supply trends with price action or other market data.
Key Features
Customizable Time Offset: Users can adjust the number of days to shift the M2 data forward or backward (from -1000 to +1000 days) via the indicator settings. This allows for alignment with historical events or forward-looking analysis.
Global Coverage Includes:
Eurozone: Eurozone M2 (converted via EUR/USD)
North America: United States, Canada
Non-EU Europe: Switzerland, United Kingdom, Finland, Russia
Pacific: New Zealand
Asia: China, Taiwan, Hong Kong, India, Japan, Philippines, Singapore
Latin America: Brazil, Colombia, Mexico
Middle East: United Arab Emirates, Turkey
Africa: South Africa
5XMA-BandA useful 5-tier SMA/EMA lines.
You can set the MA periods and indicate "EMA" or "SMA" for each.
CBA Block Tops/Bottoms w/TableHow It Works
Separate Block Sizes & Pre-Calculations: • Two inputs let you set the TOP block size and the BOTTOM block size independently (default both 5). • The script pre-calculates the highest high over the TOP block and the lowest low over the BOTTOM block using ta.highest and ta.lowest.
Horizontal Line Customization: • Users can toggle each horizontal line on or off (via showTopLine and showBottomLine). • Colors, widths, and line styles (Solid, Dotted, or Dashed) for TOP and BOTTOM lines are customizable with separate inputs. • When a block ends, if the corresponding line is enabled, a horizontal line is drawn using the user‑selected parameters.
Array Storage and Averaging: • The script appends each block’s TOP value to the tops array and each BOTTOM value to the bottoms array, keeping their sizes to a maximum defined by the lookback (default 25). • A helper function, f_avg(), safely computes the average of the array values.
Table Display: • A table is created with three columns: an index column (with fixed labels “Active”, “Prev”, “Prev-2”, “Prev-3”, “Prev-4”, “Avg”), a TOP column, and a BOTTOM column. • The first five rows display the most recent TOP and BOTTOM signals (“Active” being the most recent), and the final row shows the average values.
This code gives you full control over both the TOP and BOTTOM block calculations and the appearance of their horizontal lines, all while presenting the data in an informative table.
Morphine Moving AveragesMorphine Moving Averages (MMA) is a comprehensive technical analysis tool designed to give traders a clear, visual representation of key market trends. Combining several essential indicators into one, MMA includes:
Bollinger Bands (20 SMA, 2 standard deviation): Provides a dynamic range to identify volatility and potential reversals.
VWAP (Volume Weighted Average Price): Offers an average price weighted by volume, helping you assess market trends and potential entry points.
8 SMA: A simple moving average that helps identify short-term trends.
20 EMA: A faster-moving average that responds to recent price changes, ideal for spotting shorter-term momentum.
50 EMA: Represents a medium-term trend, smoothing out price action for better market clarity.
200 EMA: A long-term moving average, widely followed to understand the broader trend and potential support/resistance zones.
Each line is color-coded for quick identification, making it an ideal tool for both short-term and long-term traders who want a comprehensive view of the market's key levels. Use the Morphine Moving Averages indicator to spot trends, reversals, and key support/resistance levels all in one glance!
Make sure you have it pinned to price scale right.
If you have any questions or bugs, feel free to reach out to me on X. x.com
Multi-Filter Momentum OscillatorMulti-Filter Momentum Oscillator
Description
The Multi-Filter Momentum Oscillator is an advanced technical indicator that leverages multiple moving average filters to identify trend strength, momentum shifts, and potential reversal points in price action. This indicator combines a cluster-based approach with momentum analysis to provide traders with a comprehensive view of market conditions.
Key Components
Filter Cluster Analysis: The indicator creates an array of moving averages with different periods using your choice of filter (PhiSmoother, EMA, DEMA, TEMA, WMA, or SMA). These filters form a cluster that helps identify the underlying trend direction.
Composite Score: The relative positions of these filters are analyzed to generate a net score, which represents the overall trend strength and direction.
Signal Line: A smoothed version of the composite score that helps identify momentum shifts.
Four-Color Histogram: Visualizes the relationship between the score and signal line with four distinct colors:
Bright Green (Bullish Rising): Positive momentum that is accelerating
Olive Green (Bullish Falling): Positive momentum that is decelerating
Dark Red (Bearish Rising): Negative momentum that is improving
Bright Red (Bearish Falling): Negative momentum that is worsening
LazyLine Overlay: An additional triple-smoothed WMA that can be displayed on the price chart to visualize the dominant trend.
Trading Applications
Trend Direction: The oscillator's position above or below zero indicates the prevailing trend direction.
Momentum Shifts: The histogram's color changes signal momentum shifts before they become apparent in price.
Divergence Detection: Compare oscillator peaks/troughs with price action to identify potential divergences.
Overbought/Oversold Conditions: Extreme readings near the upper and lower threshold levels can indicate potential reversal zones.
Trend Confirmation: The LazyLine overlay confirms the broader trend direction on the price chart.
Customization Options
The indicator offers extensive customization through multiple parameters:
Filter type selection (PhiSmoother, EMA, DEMA, TEMA, WMA, SMA)
Cluster dispersion and trim settings
Post-smoothing options
Signal line parameters
Threshold levels
Color preferences for various elements
Histogram width and visibility
Optional swing signals with customizable placement
Modes
Trend Strength Mode: Focuses on the directional movement of the filter cluster.
Volatility Mode: Weights the score based on the bandwidth of the filter cluster, making it more responsive during volatile periods.
This versatile oscillator combines elements of trend following, momentum analysis, and volatility assessment to provide traders with actionable signals across different market conditions. The four-color histogram adds another dimension to traditional oscillator analysis by visually representing both the direction and strength of momentum shifts.
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
Adaptive Trading StrategyTrend-Following Strategy: Buys when the fast moving average crosses above the slow moving average and sells when it crosses below.
Momentum-Based Strategy: Uses RSI to detect overbought/oversold conditions.
Volatility-Based Strategy: Uses Bollinger Bands to buy near the lower band and sell near the upper band.
It uses moving averages for trend-following, RSI for momentum, and Bollinger Bands for volatility-based strategies. The script dynamically adjusts between different strategies based on market conditions.
This script adapts dynamically based on the prevailing market conditions. Let me know if you want any modifications!
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.
RSI, CCI & ADX CompositeThe RSI and CCI signals are simplified—if the RSI is above 50 it’s counted as bullish, if below it’s bearish; similarly, if the CCI is above 0 it’s bullish, below 0 it’s bearish. • The ADX is calculated manually and used as a filter. When ADX isn’t strong (below a user‑defined threshold) the composite signal simply reads “No Clear Trend.” A composite signal is then built from the two signals (RSI + CCI) and interpreted as “Strong Bullish,” “Bullish,” “Neutral,” “Bearish,” or “Strong Bearish.” In addition to simple plots of the individual indicators, a table is displayed in the top‑right corner showing numeric values (RSI, CCI, and ADX) as well as the composite signal text.
VSA Volume + Fibonacci (Volunacci)This indicator is used to draw fibo levels on the VSA volume candles
New York Session at 15:30 UTC+1 (Berlin)Verwendungszweck des Indikators:
📌 New York Session Opening:
Die Linie markiert den Beginn der New Yorker Handelssitzung (15:30 Uhr deutscher Zeit).
Diese Uhrzeit ist für Trader wichtig, da hohe Liquidität und Volatilität auftreten.
📌 Markierung eines wichtigen Marktzeitpunkts:
Viele Trader nutzen 15:30 Uhr als Einstiegspunkt oder zur Analyse von Preisbewegungen.
Die vertikale Linie hilft, historische Muster oder Preisreaktionen zum Session-Start zu identifizieren.
📌 Flexibilität und Anpassung:
Nutzer können die Linienfarbe und den Stil (durchgezogen oder gestrichelt) anpassen.
Funktioniert auf allen Timeframes und bleibt als visuelle Orientierung erhalten.
Daily Standard Deviation (fadi)The Daily Standard Deviation indicator uses standard deviation to map out daily price movements. Standard deviation measures how much prices stray from their average—small values mean steady trends, large ones mean wild swings. Drawing from up to 20 years of data, it plots key levels using customizable Fibonacci lines tied to that standard deviation, giving traders a snapshot of typical price behavior.
These levels align with a bell curve: about 68% of price moves stay within 1 standard deviation, 95% within roughly 2, and 99.7% within roughly 3. When prices break past the 1 StDev line, they’re outliers—only 32% of moves go that far. Prices often snap back to these lines or the average, though the reversal might not happen the same day.
How Traders Use It
If prices surge past the 1 StDev line, traders might wait for momentum to fade, then trade the pullback to that line or the average, setting a target and stop.
If prices dip below, they might buy, anticipating a bounce—sometimes a day or two later. It’s a tool to spot overstretched prices likely to revert and/or measure the odds of continuation.
Settings
Open Hour: Sets the trading day’s start (default: 18:00 EST).
Show Levels for the Last X Days: Displays levels for the specified number of days.
Based on X Period: Number of days to calculate standard deviation (e.g., 20 years ≈ 5,040 days). Larger periods smooth out daily level changes.
Mirror Levels on the Other Side: Plots symmetric positive and negative levels around the average.
Fibonacci Levels Settings: Defines which levels and line styles to show. With mirroring, negative values aren’t needed.
Overrides: Lets advanced users input custom standard deviations for specific tickers (e.g., NQ1! at 0.01296).
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!")
EMA Cross with Stop Loss and Take Profit with HTF ConfirmationEMA based entry signal, using HTFs for verification of trend direction before entry on LTFs
Bearish Strategy Signal
Overview
This Bearish Strategy Signal Pine Script for TradingView helps traders identify potential sell opportunities based on a combination of multiple technical indicators, aiming to reduce false signals and increase the probability of successful trades. The script combines trend , momentum , breakout , and volume confirmation for generating high-confidence sell signals.
Technical Indicators Used
1. Moving Averages (50-period and 200-period):
- Determines whether the market is in a downtrend. A 50-period moving average below the 200-period moving average is a strong bearish trend confirmation.
2. MACD (Moving Average Convergence Divergence):
- Confirms bearish momentum when the MACD line crosses below the signal line .
3. RSI (Relative Strength Index):
- Indicates if the market is in a bearish zone (below 50 ) and confirms strength when RSI crosses under 50 .
4. Bollinger Bands:
- Confirms potential breakdowns when the price is below the middle Bollinger Band , suggesting a bearish continuation.
5. Volume:
- Confirms the bearish move when volume is greater than its 20-period moving average , indicating strong selling interest.
How the Script Works
This script generates red "SELL" labels above the bars whenever all of the following conditions are met:
1. The 50-day moving average is below the 200-day moving average , confirming a bearish trend.
2. The MACD line crosses below the signal line , signaling a momentum shift to the downside.
3. The RSI is below 50 and crosses under this level, signaling increasing bearish strength.
4. The price breaks below the middle Bollinger Band , confirming a breakdown in price.
5. The volume is above the 20-period average , supporting the bearish move with strong sell pressure.
User Configuration
- Moving Average Lengths : The 50-day and 200-day moving averages can be configured.
- MACD Settings : The Fast Length (12), Slow Length (26), and Signal Length (9) for the MACD can be adjusted.
- RSI Settings : The RSI Length (14) and RSI Threshold (default 50) are configurable.
- Bollinger Bands Settings : The Bollinger Bands Length (20) and Std Dev (2.0) can be adjusted.
- Volume Settings : The Volume SMA Length (20) can be adjusted to filter for strong volume spikes.
How to Use the Script
1. Open TradingView and go to the Pine Editor .
2. Paste the provided code into the editor.
3. Click Add to Chart to see the signals on your chart.
4. Adjust the settings to suit your preferences.
5. Watch for red "SELL" labels above the bars to identify bearish signals.
Normalised Price Crossover - MACD but TickersEver noticed two different tickers are correlated yet have different lags? Ever find one ticker moves first and when the other finally goes to catch up, the first one has already reversed?
So I thought to myself, would be wicked if I took the faster one and made it into a 'Signal Line' and the slow one and made it into a 'Slow Line' almost like a MACD if you will.
So that's what I did, I took the price charts of the tickers and I normalised the price data so they could actually cross, plotted it and sat back to see it generate signals, lo and behold!
Pretty neat, though I'd advise to use spreads and such for the different tickers to really feel the power of the indicator, works well when you use formulas that model actual mechanisms instead of arbitrary price data of different assets as correlation =/= causation.
Enjoy.
200 Day SMA HighlighterHighlights area under chart for 200 day moving average (adjustable).
Shows color coding for when price is above or below the sma.