//@version=6
// Alert Conditions — Complete Reference
// github.com/trugurpala/pinescriptv6 — Author: Ugur Pala
indicator("Alert Examples [trugurpala]", overlay=true)
// ── Inputs ───────────────────────────────────────────────────────────────────
int fastLen = input.int(9, "Fast EMA", minval=1)
int slowLen = input.int(21, "Slow EMA", minval=1)
int rsiLen = input.int(14, "RSI", minval=1)
// ── Calculations ─────────────────────────────────────────────────────────────
float fastEma = ta.ema(close, fastLen)
float slowEma = ta.ema(close, slowLen)
float rsi = ta.rsi(close, rsiLen)
float atr = ta.atr(14)
bool bullCross = ta.crossover(fastEma, slowEma)
bool bearCross = ta.crossunder(fastEma, slowEma)
bool rsiOb = ta.crossunder(rsi, 70)
bool rsiOs = ta.crossover(rsi, 30)
// ── alertcondition() — Kullanıcı manuel alarm kurar ──────────────────────────
// TR: TradingView'da elle alarm oluşturmak için
// EN: For manually creating alerts in TradingView UI
alertcondition(bullCross,
title = "EMA Bull Cross",
message = "🟢 EMA Bull | {{ticker}} | {{interval}} | {{close}}")
alertcondition(bearCross,
title = "EMA Bear Cross",
message = "🔴 EMA Bear | {{ticker}} | {{interval}} | {{close}}")
alertcondition(rsiOb,
title = "RSI Overbought Exit",
message = "⚠️ RSI OB Exit | {{ticker}} | RSI seviyesi 70 altına düştü")
alertcondition(rsiOs,
title = "RSI Oversold Exit",
message = "⚠️ RSI OS Exit | {{ticker}} | RSI seviyesi 30 üstüne çıktı")
// ── alert() — Kod içinde tetiklenir ──────────────────────────────────────────
// TR: Koşul gerçekleşince otomatik tetiklenir
// EN: Fires automatically when condition is met
// Her bar başına bir kez
if bullCross
alert("🟢 BULL CROSS | " + syminfo.ticker + " | " + str.tostring(close),
alert.freq_once_per_bar)
// Sadece bar kapanışında
if bearCross
alert("🔴 BEAR CROSS | " + syminfo.ticker + " | " + str.tostring(close),
alert.freq_once_per_bar_close)
// Her tickte (dikkatli kullan!)
// if someCondition
// alert("msg", alert.freq_all)
// ── JSON webhook örneği ───────────────────────────────────────────────────────
// TR: Bu mesajı TradingView Alert → Message kutusuna yapıştır
// EN: Paste this in TradingView Alert → Message box
// {
// "symbol": "{{ticker}}",
// "action": "buy",
// "price": {{close}},
// "interval": "{{interval}}",
// "atr": "hesaplanacak"
// }
// ── Visuals ──────────────────────────────────────────────────────────────────
plot(fastEma, "Fast", fastEma > slowEma ? color.green : color.red, linewidth=2)
plot(slowEma, "Slow", fastEma > slowEma ? color.lime : color.orange, linewidth=2)
plotshape(bullCross, "Bull", shape.triangleup, location.belowbar, color.green)
plotshape(bearCross, "Bear", shape.triangledown, location.abovebar, color.red)
Overview
Alert Examples plots the two EMAs on the price chart with dynamic coloring and displays triangle shapes on crossovers. Bullish cross triggers a buy alert while bearish cross signals a sell alert; RSI levels provide additional exit conditions. Inputs control the lengths of the EMAs and RSI period. Signals fire as alerts that can connect to external webhooks for automated trading systems. The indicator draws directly on the main price chart without separate panes.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Fast EMA
int
9
fastLen
Slow EMA
int
21
slowLen
RSI
int
14
rsiLen
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This indicator calculates key support and resistance levels by analyzing the first and second momentum derivatives of a Double Exponential Moving Average (DEMA). When the second derivative (momentum of momentum) crosses zero, it identifies local turning points
Moon Dev Lunar Sniper is a multi-indicator overlay that scores confluence across fast and slow EMAs, RSI, MACD, DMI, and BB width to fire signals only when score meets the minimum threshold. It plots buy and sell signals on the price chart, highlights cosmic b
Self-Aware Trend System calculates volatility-adaptive ATR trailing bands using a Trend Quality Index engine that evaluates market efficiency, momentum persistence, and structural pivots. It plots adaptive trend bands and character-flip trend signals directly
This intraday overlay establishes directional bias and high-conviction swing setups for SPY on the 15-minute timeframe. It computes a weighted confluence score combining an EMA ribbon, a 50 EMA anchor, session VWAP bands, RSI divergence, ADX, TTM Squeeze, cand
Market Trend is an overlay indicator that identifies market direction and key price levels. It calculates a Relative Strength Index with Bollinger Bands to construct a 20-step color gradient reflecting momentum shifts. The script incorporates exponential movin
This script provides an indicator-based backtesting engine framework that simulates trade entries, exits, and filtering directly on the price chart. It evaluates selected entry rules and multi-layered filters, including moving average trends, volume increases,