PriceCatch Stock Range Binning-v1Hi Traders.
This is a simple script that will show you the number of times an instrument was within a change% zone. For example, you will know how many times it was between 5% and 10%, or 1% and 3%. So with this info, you will be able to set your expectation regarding the move the instrument is likely to make on any trading day. So, if you notice that the instrument has moved into a higher zone, then you can estimate to an extent where it will attempt to go.
Play with it and you will know its use.
I have kept the source open so that you can study it yourself and make any changes as per your needs.
Remember, this is not an indicator but just an info script.
All the best with your trades.
Indicators and strategies
Crypto Scanner IndicatorExplanation of Criteria
Highest High of 125 Days:
Compares the current closing price to the highest price in the last 125 days.
Triggers when the close equals the highest high (adjust to >= if you want to include closes above prior highs).
Volume Double the 125-Day Average:
Checks if the current volume is at least twice the average volume of the past 125 days.
RSI Below 70:
Uses the 14-period RSI to avoid overbought conditions (RSI < 70).
Enhanced Gold Strategy (15M)Enhanced Gold Trading Strategy (15M)
This Pine Script strategy is designed for gold trading on a 15-minute timeframe, optimizing trend and momentum signals for high-probability trades. It incorporates multiple technical indicators to filter out false signals and improve trade accuracy.
Key Features:
✅ Moving Average Crossovers – Uses a 20-period short MA and 50-period long MA to identify trend shifts.
✅ Relative Strength Index (RSI) – Helps confirm overbought and oversold conditions to time entries better.
✅ Bollinger Bands Expansion – Ensures trades occur only in high-volatility market conditions.
✅ ADX Trend Strength Filter – Filters out trades in weak or choppy markets by requiring a trend strength above 20.
✅ Dynamic Support & Resistance – Uses the last 50-period high/low levels instead of static price levels.
✅ ATR-Based Stop-Loss & Take-Profit – Adapts dynamically to market conditions for optimal risk management.
✅ London/New York Overlap Filter – Restricts trading to the most liquid market hours (1 PM - 4 PM GMT).
Trading Logic:
Long Entry:
Short MA crosses above Long MA (Bullish crossover).
RSI below oversold level (Potential reversal).
Bollinger Bands expansion (Confirming strong momentum).
Price near dynamic support level (Ensuring a key level is respected).
ADX above 20 (Validating a strong trend).
Short Entry:
Short MA crosses below Long MA (Bearish crossover).
RSI above overbought level (Potential reversal).
Bollinger Bands expansion (Confirming strong momentum).
Price near dynamic resistance level (Ensuring a key level is respected).
ADX above 20 (Validating a strong trend).
This strategy is built for high-probability gold trades by combining trend-following, momentum, and volatility factors. With adaptive risk management, it ensures controlled losses and optimized profit potential.
Big Fish Small Fish Yummy (Forex)This indicator is a versatile, multi-functional tool built in Pine Script™ (v6) that blends volatility, price action, and risk management to help you spot key forex trading opportunities. Here’s what it offers:
Key Features:
ATR & Candle Analysis:
Utilizes the Average True Range (ATR) to gauge market volatility. It identifies “Big Fish” candles—those with significant bullish or bearish momentum—by comparing the current candle’s range against a multiple of the previous ATR. It also evaluates wick sizes to detect “yummy” pin bars, signaling potential reversals or precise entry/exit points.
Swing Detection:
Incorporates a swing detection system that examines recent price action over a user-defined lookback period. By confirming valid swing highs and lows through trend analysis and sequence validation, the script highlights potential shifts in market momentum.
Risk & Lot Size Calculator:
Features a built-in calculator that uses your capital, chosen risk percentage, and ATR-derived pip values to compute optimal lot sizes. The script adjusts calculations based on different symbols and currencies, ensuring proper sizing for various forex pairs.
Multi-Pair Data Integration:
Pulls daily price data from OANDA for several major currency pairs (e.g., USD/JPY, USD/CHF, AUD, GBP, NZD, CAD, EUR), which supports accurate cross-market analysis and risk adjustments.
SMA & Lookback Visualization:
Plots three Simple Moving Averages (SMAs) to provide additional trend context. A customizable lookback highlight further accentuates recent price movements, making it easier to identify relevant market conditions.
How It Works
ATR Calculation & Candle Evaluation:
The script computes the ATR over a user-specified period and uses it to determine whether a candle qualifies as a “Big Fish” based on its range. Both bullish and bearish conditions are assessed.
Swing & Pin Bar Identification:
Through a combination of swing range validation, linear regression for trend confirmation, and sequence checks, the indicator marks potential swing highs and lows. It then monitors subsequent bars for “yummy” pin bar patterns—small bodies with relatively large wicks—which may signal reversals.
Risk Management & Lot Sizing:
Once a qualifying candle is identified, the script calculates stop-loss levels and suggests a lot size tailored to your account balance and risk settings. This dynamic adjustment factors in the pip value differences among various currency pairs.
Visual Cues & Labels:
The indicator uses colored bars and plotted shapes to highlight swing changes and fish candle events. Informative labels display key metrics like ATR pips, calculated lot size, and account capital, providing a quick overview of potential trade setups.
Customization
Input Parameters:
Adjust ATR length, multipliers for both big and small fish, swing lookback periods, and wick size thresholds to suit your trading style.
Display Options:
Toggle visual elements such as ATR pip display, lot size, and capital information on labels.
SMA Settings:
Set the lengths for three SMAs to help visualize trend direction.
Antony Moving Average (AMA)EMA 9 (Blue), EMA 20 (Red), SMA 65 (Green), and SMA 200 (Yellow). Most times the stock respects 65 instead of 50 and so choosing 65 helps in better results.
Historical Risk IndicatorHistorical Risk Indicator — это инструмент, анализирующий ценовую историю актива за заданный период (в месяцах) и оценивающий уровень риска относительно локальных экстремумов. Индикатор рассчитывает процентное расположение текущей цены в диапазоне `минимум–максимум` за заданное количество месяцев.
- 🟢 Зеленый цвет: Низкий риск (цена ближе к минимумам периода).
- 🟠 Оранжевый цвет: Средний риск (цена в среднем диапазоне).
- 🔴 Красный цвет: Высокий риск (цена ближе к максимумам периода).
Этот индикатор помогает трейдерам понимать, насколько текущая цена находится в зоне риска по сравнению с историческим диапазоном.
⚙️ Входные параметры:
- Количество месяцев для анализа (по умолчанию 12) — устанавливает временной диапазон, на основе которого вычисляются уровень риска и ценовые экстремумы.
📊 Как использовать?
- Используется для оценки рыночного положения актива по отношению к его историческим максимумам и минимумам.
- Помогает находить моменты, когда цена находится в "беспокойной" зоне.
- Может быть полезным как самостоятельный инструмент, так и в сочетании с другими индикаторами.
🎯 Идеально подходит для позиционных и свинг-трейдеров, анализирующих долгосрочные движения цены! 🚀
Delta% per CandleIl delta% nell'indicatore rappresenta la percentuale dell'imbalzo tra il volume degli acquisti e delle vendite in una singola barra. In altre parole, viene calcolato come:
Delta% = (Volume Buy – Volume Sell) / Volume Totale × 100
It's better to use it for futures—enjoy!
EMA POD Indicator #gangesThis script is a technical analysis indicator that uses multiple Exponential Moving Averages (EMAs) to identify trends and track price changes in the market. Here's a breakdown:
EMA Calculation: It calculates six different EMAs (for periods 5, 10, 20, 50, 100, and 150) to track short- and long-term trends.
Trend Identification:
Uptrend: The script identifies an uptrend when the EMAs are in ascending order (EMA5 > EMA10 > EMA20 > EMA50 > EMA100 > EMA150).
Downtrend: A downtrend is identified when the EMAs are not in ascending order.
Trend Change Tracking: It tracks when an uptrend starts and ends, displaying the duration of the trend and the percentage price change during the trend.
Visuals:
It plots the EMAs on the chart with different colors.
It adds green and red lines to represent the ongoing uptrend and downtrend.
Labels are displayed showing when the uptrend starts and ends, along with the trend's duration and price change percentage.
In short, this indicator helps visualize trends, track their changes, and measure the impact of those trends on price.
PSAR & RSI Strategy with Risk Management navin✅ Custom Buy & Sell Conditions:
Buy: When price crosses above PSAR and RSI is oversold (<30)
Sell: When price crosses below PSAR and RSI is overbought (>70)
✅ Take Profit & Stop Loss Added:
Take Profit: +5% from the entry price (adjustable)
Stop Loss: -3% from the entry price (adjustable)
✅ Dynamic RSI Color Coding:
Green when RSI is oversold (<30)
Red when RSI is overbought (>70)
Blue in the neutral range
✅ Alerts for Trading Signals:
Sends alerts when buy/sell conditions trigger
✅ Strategy Execution for Backtesting:
Opens Long Trades when a buy signal appears
Closes Trade Automatically on a sell signal, take profit, or stop loss
Micha Stocks Custom Watermark (fixed offsetY by n.b)fixed Y offset so no overlap with other indicators.
special thanks to "micha stocks" for the idea.
Ultimate Multi-Timeframe Indicator//@version=5
indicator("Ultimate Multi-Timeframe Indicator", overlay=true)
// EMA Ayarları
ema50 = ta.ema(close, 50)
ema200 = ta.ema(close, 200)
trendBullish = ta.crossover(ema50, ema200)
trendBearish = ta.crossunder(ema50, ema200)
// RSI Ayarları
rsi = ta.rsi(close, 14)
rsiOverbought = 70
rsiOversold = 30
rsiBullish = rsi < rsiOversold
rsiBearish = rsi > rsiOverbought
// MACD Ayarları
= ta.macd(close, 12, 26, 9)
macdBullish = ta.crossover(macdLine, signalLine)
macdBearish = ta.crossunder(macdLine, signalLine)
// Bollinger Bantları
bbBasis = ta.sma(close, 20)
bbUpper = bbBasis + ta.stdev(close, 20) * 2
bbLower = bbBasis - ta.stdev(close, 20) * 2
bbBreakout = close > bbUpper or close < bbLower
// Giriş & Çıkış Sinyalleri
buySignal = trendBullish and macdBullish and rsiBullish
sellSignal = trendBearish and macdBearish and rsiBearish
// Grafikte Gösterimler
plot(ema50, color=color.blue, title="EMA 50")
plot(ema200, color=color.red, title="EMA 200")
plot(bbUpper, color=color.green, title="Bollinger Upper")
plot(bbLower, color=color.green, title="Bollinger Lower")
plot(bbBasis, color=color.orange, title="Bollinger Basis")
// Alış & Satış İşaretleri
plotshape(series=buySignal, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY Signal", text="BUY")
plotshape(series=sellSignal, location=location.abovebar, color=color.red, style=shape.labeldown, title="SELL Signal", text="SELL")
// Uyarılar
alertcondition(buySignal, title="BUY Alert", message="Strong Buy Signal")
alertcondition(sellSignal, title="SELL Alert", message="Strong Sell Signal")
// Al-Sat Sinyalleri için Etiketler
bgcolor(buySignal ? color.green : na, transp=90)
bgcolor(sellSignal ? color.red : na, transp=90)
Pulse of Cycle Oscillator"Pulse of Cycle" Oscillator: Logic and Usage
What Is It and How Does It Work?
The "Pulse of Cycle" is an oscillator that measures the cycles of price rises and falls, helping you spot overbought and oversold conditions. Unlike classic indicators, it doesn’t focus on how much the price moves but tracks its direction (up or down) like a "pulse." Here’s the logic:
Price Movement:
If the price rises compared to the previous bar, it adds +1.
If the price falls, it subtracts -1.
If the price stays the same, it adds 0.
Decay Factor: Each step, the previous value is multiplied by a factor (e.g., 0.9) to shrink it slightly. This keeps the oscillator from growing too big and focuses it on recent price action.
Signals: The oscillator moves around zero. When it crosses certain levels (e.g., 5 and 10), it warns you about overbought or oversold zones:
Weak Signal: Above ±5, the market might be stretching a bit.
Strong Signal: Above ±10, a reversal is more likely.
In short, it tracks the "rhythm" of price streaks (consecutive ups or downs) and signals when things might be getting extreme.
How It Looks on the Chart
Line: The oscillator moves around a zero line.
Colors:
Blue: Normal zone (between -5 and +5).
Orange: Weak overbought (+5 and up) or oversold (-5 and down).
Red: Strong overbought (+10 and up).
Lime: Strong oversold (-10 and down).
Threshold Lines: You’ll see lines at 0, ±5, and ±10 on the chart to show where you are.
How to Use It?
Here’s how to trade with this oscillator:
Buy Opportunity (Long Position):
When?: The oscillator drops below -5 (weak) or -10 (strong), then starts moving back toward zero. This suggests the price has hit a bottom and might rise.
Example: It falls to -12 (lime), then rises to -8. You could buy, expecting a bounce.
Tip: Wait for a green candle to confirm if you want to be safer.
Sell Opportunity (Short Position):
When?: The oscillator rises above +5 (weak) or +10 (strong), then starts dropping back toward zero. This indicates the price might have peaked and could fall.
Example: It hits +11 (red), then drops to +7. You could sell, expecting a decline.
Tip: Look for a red candle to confirm the turn.
Neutral Zone: If it’s between -5 and +5, the market is balanced. You can wait for a clearer signal.
Practical Steps to Use
Add to TradingView:
Paste the code into Pine Editor and click “Add to Chart.”
Adjust Settings (Optional):
Decay (0.9): Lower to 0.7 for faster response, raise to 0.95 for smoother movement.
Thresholds (5 and 10): Change them (e.g., 4 and 8) based on your market.
Watch Signals:
Follow the color changes and threshold crossings.
Set Alerts:
Right-click the oscillator > “Add Alert” to get notified on overbought/oversold signals.
Things to Watch Out For
Confirmation: Pair it with support/resistance levels or candlestick patterns for stronger signals.
Market Type: Works best in range-bound (sideways) markets. In strong trends (all up or down), signals might mislead.
Risk: Always use a stop loss—below the last low for buys, above the last high for sells.
Summary
The "Pulse of Cycle" is a simple yet powerful tool that tracks price movement streaks. Use it to catch reversals at strong signals (-10/+10) or get early warnings at weak signals (±5). The colors and lines on the chart make it easy to see when to act.
NSE Index Strategy with Entry/Exit MarkersExplanation of the Code
Trend Filter (200 SMA):
The line trendSMA = ta.sma(close, smaPeriod) calculates the 200‑period simple moving average. By trading only when the current price is above this SMA (inUptrend = close > trendSMA), we aim to trade in the direction of the dominant trend.
RSI Entry Signal:
The RSI is calculated with rsiValue = ta.rsi(close, rsiPeriod). The script checks for an RSI crossover above the oversold threshold using ta.crossover(rsiValue, rsiOversold). This helps capture a potential reversal from a minor pullback in an uptrend.
ATR-Based Exits:
ATR is computed by atrValue = ta.atr(atrPeriod) and is used to set the stop loss and take profit levels:
Stop Loss: stopLossPrice = close - atrMultiplier * atrValue
Take Profit: takeProfitPrice = close + atrMultiplier * atrValue
This dynamic approach allows the exit levels to adjust according to the current market volatility.
Risk and Money Management:
The strategy uses a fixed percentage of equity (10% by default) for each trade. The built‑in commission parameter helps simulate real-world trading costs.
Holy MollySell when the last closed candle has the purpe marking.
Buy when the last candle gets a green marking.
TP is alawys the horizontal line.
Tweak the settings for your liking, the threshold should be set always to the actual pair, to be within a few pips or points, you can get references from the chart, where you have two loes or highs really close almost with zero difference, if those are shown only, your settings is ok.
Do a back test, you will see, price eventually always gets there. Mostly the very next candle but sometimes it takes a few candles.
Línea Vertical de Horas importantes NYEste script marca visualmente momentos clave en la sesión de Nueva York dentro del gráfico de TradingView: ✅ Dibuja líneas verticales en horarios clave.
✅ Guarda el precio de apertura de la medianoche.
✅ Calcula los máximos y mínimos de las últimas 500 barras.
✅ Sombrea el intervalo de 11:00 a 13:30.
Este indicador es útil para traders que operan con base en sesiones horarias y quieren resaltar estos momentos en su análisis.
Range Breakout [BigBeluga]Range Breakout is a dynamic channel-based indicator designed to identify breakout opportunities and price reactions within defined ranges. It automatically creates upper and lower bands with a midline, helping traders spot breakout zones, retests, and potential fakeouts.
🔵 Key Features:
Dynamic Channel Formation:
Automatically plots upper and lower channel bands with a midline based on ATR calculations.
Channels adjust upon breakout events or after a predefined number of bars to reflect new price ranges.
Breakout Detection:
Green circles appear when price breaks above the upper channel edge.
Red circles appear when price breaks below the lower channel edge.
A new channel is formed after each breakout, allowing traders to monitor evolving price ranges.
Retest Signals:
Upward-pointing green triangles signal a retest of the lower band, indicating potential support.
Downward-pointing red triangles indicate a retest of the upper band, suggesting possible resistance.
Filter Signals by Trends (New Feature):
Optional toggle to filter ▲ and ▼ signals based on channel breakout conditions.
When enabled:
In a bullish channel (confirmed by a green circle breakout), only ▲ signals are displayed.
In a bearish channel (confirmed by a red circle breakout), only ▼ signals are displayed.
Helps traders align retest signals with the prevailing trend for higher-quality trade setups.
Fakeout Identification:
'X' symbols appear when price breaks the upper or lower edge of the channel and quickly returns back inside.
Helps traders identify and avoid false breakouts.
🔵 Usage:
Breakout Trading: Use the green and red circle signals to identify potential breakout trades.
Retest Confirmation: Look for triangle markers to confirm retests of key levels, aiding in entry or exit decisions.
Fakeout Alerts: Utilize the 'X' signals to spot and avoid potential trap moves.
Dynamic Range Monitoring: Stay aware of changing market conditions with automatically updating channels.
Range Breakout is an essential tool for traders seeking to capitalize on range breakouts, retests, and fakeout scenarios. Its dynamic channels and clear visual signals provide a comprehensive view of market structure and potential trade setups.
Quicktrade703@quicktrade703This indicator best work in option trading for Intraday . You can use this in 5 minute time frame chart and take trade as per ema and stop loss as per vstop .Try for 1:2 target for best performance
Trend Yönü Ölçer - Mustafa Üstün//@version=5
indicator("Trend Yönü Ölçer", overlay=false)
// Parametreler
length = input(14, title="Hesaplama Periyodu")
// Hareket Yönü Hesaplama
priceChange = close - ta.sma(close, length)
// Trend Yönü Belirleme (-1, 0, 1)
trendDirection = priceChange > 0 ? 1 : priceChange < 0 ? -1 : 0
// Renk Belirleme
colorTrend = trendDirection == 1 ? color.green : trendDirection == -1 ? color.red : color.gray
// Gösterge Çizimi
plot(trendDirection, title="Trend Yönü", color=colorTrend, linewidth=2, style=plot.style_columns)
hline(0, "Nötr Bölge", color=color.gray, linestyle=hline.style_dotted)
Price Change IndicatorPrice Change Indicator (PCI)
Version: 1.0
Author: LazyTrader 🚀
🔍 Overview
The Price Change Indicator (PCI) helps traders visualize and compare price changes between the current bar and the previous bar. It provides a customizable display of price changes in two formats:
Percentage (%) Change – Relative price movement.
Natural Change – Absolute difference in price units.
⚙️ Key Features
✅ Customizable Calculation Method: Choose how the price change is calculated:
Opening Price
Closing Price
High
Low
✅ Flexible Display Format:
Show Percentage (%) Change.
Show Natural (Absolute) Change in price.
✅ Adjustable Sensitivity with Multiplier:
100 (Standard Change)
1000 (Small Change)
10000 (Tiny Change)
✅ Intuitive Labeling:
Green label (above bar) for increase.
Red label (below bar) for decrease.
No label if no change.
Large, easy-to-read labels for better visibility.
✅ Perfect for Any Market:
Stocks 📈
Forex 💱
Crypto 🚀
Commodities 🛢️
📊 How It Works
The indicator calculates the difference between the current and previous bar’s price based on your chosen method.
The result is displayed as either a percentage (%) or a natural price change.
If the price has increased, a green label is displayed above the bar.
If the price has decreased, a red label is displayed below the bar.
⚡ How to Use
Add the indicator to your chart.
Go to settings and customize:
Select calculation method (Open, Close, High, Low).
Choose display format (% or Natural Change).
Adjust multiplier for more sensitivity.
Analyze the labels to see price movements easily!
🔧 Settings Explained
Setting Description
Price Calculation Method: Choose Open, Close, High, or Low price for comparison.
Display Format: Show either % Change or Natural Change.
Multiplier: Apply 100, 1000, or 10000 to scale small price changes.
Show Labels: Toggle labels on/off.
🎯 Best Use Cases
🔹 Identifying strong price movements
🔹 Spotting trends and momentum shifts
🔹 Comparing price movement intensity
🔹 Works for scalping, swing trading, and long-term analysis
Daily Gap FillOn pre-market or market open, fade the day's gap. Settings available to close the trade a little early, and to have a stop loss.
Session Boxes Higher / Low + Nachhandelszeiten//@version=6
indicator("Session Boxes", overlay=true)
// Zeit-Einstellung
is_summertime = input.bool(true, title="Sommerzeit aktiv", group="Zeiteinstellung", tooltip="Bei Winterzeit werden alle Zeiten automatisch um 1 Stunde früher angesetzt")
time_offset = is_summertime ? 0 : -1 // -1 Stunde im Winter
// Einstellungen für Sessions anzeigen/ausblenden
show_asia = input.bool(true, title="Asien Session anzeigen", group="Session Anzeige")
show_london = input.bool(true, title="London Session anzeigen", group="Session Anzeige")
show_ny_morning = input.bool(true, title="New York Vormittag anzeigen", group="Session Anzeige")
show_ny_afternoon = input.bool(true, title="New York Nachmittag anzeigen", group="Session Anzeige")
show_afterhours = input.bool(true, title="Nachhandelszeit anzeigen (2h)", group="Session Anzeige")
// Zeiten konfigurierbar machen (Sommerzeit-Zeiten, werden automatisch für Winterzeit angepasst)
asia_start = input.float(1.0, title="Asien Start (Stunde)", minval=0, maxval=23.59, step=0.5, group="Asien Zeiten")
asia_end = input.float(7.0, title="Asien Ende (Stunde)", minval=0, maxval=23.59, step=0.5, group="Asien Zeiten")
london_start = input.float(9.0, title="London Start (Stunde)", minval=0, maxval=23.59, step=0.5, group="London Zeiten")
london_end = input.float(11.0, title="London Ende (Stunde)", minval=0, maxval=23.59, step=0.5, group="London Zeiten")
ny_morning_start = input.float(15.5, title="NY Vormittag Start (Stunde)", minval=0, maxval=23.59, step=0.5, group="NY Vormittag Zeiten")
ny_morning_end = input.float(17.0, title="NY Vormittag Ende (Stunde)", minval=0, maxval=23.59, step=0.5, group="NY Vormittag Zeiten")
ny_afternoon_start = input.float(19.5, title="NY Nachmittag Start (Stunde)", minval=0, maxval=23.59, step=0.5, group="NY Nachmittag Zeiten")
ny_afternoon_end = input.float(21.0, title="NY Nachmittag Ende (Stunde)", minval=0, maxval=23.59, step=0.5, group="NY Nachmittag Zeiten")
// Angepasste Zeiten mit Sommer/Winterzeit-Offset
asia_start_adjusted = asia_start + time_offset
asia_end_adjusted = asia_end + time_offset
london_start_adjusted = london_start + time_offset
london_end_adjusted = london_end + time_offset
ny_morning_start_adjusted = ny_morning_start + time_offset
ny_morning_end_adjusted = ny_morning_end + time_offset
ny_afternoon_start_adjusted = ny_afternoon_start + time_offset
ny_afternoon_end_adjusted = ny_afternoon_end + time_offset
// Berechnung der Bars für 2 Stunden basierend auf dem Timeframe
t = str.tonumber(timeframe.period)
bars_2hours = int(120 / t) // 120 Minuten = 2 Stunden
// Farben für die verschiedenen Sessions
asia_color = input.color(color.new(color.red, 70), title="Asien Session Farbe", group="Farben")
london_color = input.color(color.new(color.blue, 70), title="London Session Farbe", group="Farben")
ny_morning_color = input.color(color.new(color.green, 70), title="NY Vormittag Farbe", group="Farben")
ny_afternoon_color = input.color(color.new(color.purple, 70), title="NY Nachmittag Farbe", group="Farben")
// Nachhandelszeit Farben (heller als die Hauptsessions)
asia_afterhours_color = color.new(color.red, 85)
london_afterhours_color = color.new(color.blue, 85)
ny_morning_afterhours_color = color.new(color.green, 85)
ny_afternoon_afterhours_color = color.new(color.purple, 85)
// Funktionen zur Überprüfung, ob wir uns in einer bestimmten Session befinden
inAsiaSession(t) =>
h = hour(t)
m = minute(t)
time_decimal = h + m/60
time_decimal >= asia_start_adjusted and time_decimal < asia_end_adjusted
inLondonSession(t) =>
h = hour(t)
m = minute(t)
time_decimal = h + m/60
time_decimal >= london_start_adjusted and time_decimal < london_end_adjusted
inNYMorningSession(t) =>
h = hour(t)
m = minute(t)
time_decimal = h + m/60
time_decimal >= ny_morning_start_adjusted and time_decimal < ny_morning_end_adjusted
inNYAfternoonSession(t) =>
h = hour(t)
m = minute(t)
time_decimal = h + m/60
time_decimal >= ny_afternoon_start_adjusted and time_decimal < ny_afternoon_end_adjusted
// High/Low-Berechnung für Asien Session
var float asiaHigh = na
var float asiaLow = na
var int asiaStartBar = na
var bool inAsiaSessionPrev = false
inAsiaSessionCurr = inAsiaSession(time)
if inAsiaSessionCurr and not inAsiaSessionPrev
asiaHigh := high
asiaLow := low
asiaStartBar := bar_index
else if inAsiaSessionCurr
asiaHigh := math.max(asiaHigh, high)
asiaLow := math.min(asiaLow, low)
else if not inAsiaSessionCurr and inAsiaSessionPrev and show_asia
box.new(asiaStartBar, asiaHigh, bar_index, asiaLow, asia_color, bgcolor=asia_color)
if show_afterhours
box.new(bar_index, asiaHigh, bar_index + int(bars_2hours), asiaLow, asia_afterhours_color, bgcolor=asia_afterhours_color)
asiaHigh := na
asiaLow := na
inAsiaSessionPrev := inAsiaSessionCurr
// High/Low-Berechnung für London Session
var float londonHigh = na
var float londonLow = na
var int londonStartBar = na
var bool inLondonSessionPrev = false
inLondonSessionCurr = inLondonSession(time)
if inLondonSessionCurr and not inLondonSessionPrev
londonHigh := high
londonLow := low
londonStartBar := bar_index
else if inLondonSessionCurr
londonHigh := math.max(londonHigh, high)
londonLow := math.min(londonLow, low)
else if not inLondonSessionCurr and inLondonSessionPrev and show_london
box.new(londonStartBar, londonHigh, bar_index, londonLow, london_color, bgcolor=london_color)
if show_afterhours
box.new(bar_index, londonHigh, bar_index + int(bars_2hours), londonLow, london_afterhours_color, bgcolor=london_afterhours_color)
londonHigh := na
londonLow := na
inLondonSessionPrev := inLondonSessionCurr
// High/Low-Berechnung für NY Morning Session
var float nyMorningHigh = na
var float nyMorningLow = na
var int nyMorningStartBar = na
var bool inNYMorningSessionPrev = false
inNYMorningSessionCurr = inNYMorningSession(time)
if inNYMorningSessionCurr and not inNYMorningSessionPrev
nyMorningHigh := high
nyMorningLow := low
nyMorningStartBar := bar_index
else if inNYMorningSessionCurr
nyMorningHigh := math.max(nyMorningHigh, high)
nyMorningLow := math.min(nyMorningLow, low)
else if not inNYMorningSessionCurr and inNYMorningSessionPrev and show_ny_morning
box.new(nyMorningStartBar, nyMorningHigh, bar_index, nyMorningLow, ny_morning_color, bgcolor=ny_morning_color)
if show_afterhours
box.new(bar_index, nyMorningHigh, bar_index + int(bars_2hours), nyMorningLow, ny_morning_afterhours_color, bgcolor=ny_morning_afterhours_color)
nyMorningHigh := na
nyMorningLow := na
inNYMorningSessionPrev := inNYMorningSessionCurr
// High/Low-Berechnung für NY Afternoon Session
var float nyAfternoonHigh = na
var float nyAfternoonLow = na
var int nyAfternoonStartBar = na
var bool inNYAfternoonSessionPrev = false
inNYAfternoonSessionCurr = inNYAfternoonSession(time)
if inNYAfternoonSessionCurr and not inNYAfternoonSessionPrev
nyAfternoonHigh := high
nyAfternoonLow := low
nyAfternoonStartBar := bar_index
else if inNYAfternoonSessionCurr
nyAfternoonHigh := math.max(nyAfternoonHigh, high)
nyAfternoonLow := math.min(nyAfternoonLow, low)
else if not inNYAfternoonSessionCurr and inNYAfternoonSessionPrev and show_ny_afternoon
box.new(nyAfternoonStartBar, nyAfternoonHigh, bar_index, nyAfternoonLow, ny_afternoon_color, bgcolor=ny_afternoon_color)
if show_afterhours
box.new(bar_index, nyAfternoonHigh, bar_index + int(bars_2hours), nyAfternoonLow, ny_afternoon_afterhours_color, bgcolor=ny_afternoon_afterhours_color)
nyAfternoonHigh := na
nyAfternoonLow := na
inNYAfternoonSessionPrev := inNYAfternoonSessionCurr
Support et Résistance Automatiques//@version=5
indicator("Support et Résistance Automatiques", overlay=true)
// Paramètres de l'utilisateur
lookback = input.int(50, title="Période d'analyse", minval=1)
// Variables pour les niveaux de support et résistance
var float support = na
var float resistance = na
// Trouver le support (plus bas sur la période donnée)
if (low == ta.lowest(low, lookback))
support := low
// Trouver la résistance (plus haut sur la période donnée)
if (high == ta.highest(high, lookback))
resistance := high
// Tracer les niveaux de support et de résistance
if (not na(support))
line.new(bar_index, support, bar_index + 1, support, color=color.green, width=2, extend=extend.right)
if (not na(resistance))
line.new(bar_index, resistance, bar_index + 1, resistance, color=color.red, width=2, extend=extend.right)
// Affichage des niveaux actuels sur le graphique
if (not na(support))
label.new(bar_index, support, text="Support: " + str.tostring(support), color=color.new(color.green, 80), textcolor=color.white, size=size.small)
if (not na(resistance))
label.new(bar_index, resistance, text="Résistance: " + str.tostring(resistance), color=color.new(color.red, 80), textcolor=color.white, size=size.small)