1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
78 lines of Pine Script v6 from ema_crossover_+_OI_flip.pine, published under MPL-2.0. Keep the author's credit and licence lines when you reuse it.
ema_crossover_+_OI_flip.pine
// ══════════════════════════════════════════════════════════════════════════════
// INDIKATOR: 15m Trend Reversal [EMA + OI Flip]
// Zeigt NUR Kauf/Verkauf Signale an (Keine Strategie-Berechnung)
// ══════════════════════════════════════════════════════════════════════════════
//@version=6
indicator("15m EMA + OI Flip Signals", overlay=true)
// ══════════════════════════════════════════════════════════════════════════════
// 1. EINSTELLUNGEN (INPUTS)
// ══════════════════════════════════════════════════════════════════════════════
// EMA Einstellungen
grp_ema = "═══ EMA TREND ═══"
len_fast = input.int(9, "Fast EMA (Signal)", group=grp_ema)
len_slow = input.int(15, "Slow EMA (Baseline)", group=grp_ema)
// Open Interest Einstellungen
grp_oi = "═══ OPEN INTEREST FILTER ═══"
use_oi = input.bool(true, "Benutze OI Filter?", group=grp_oi)
// Falls du ETH handelst, ändere dies zu BINANCE:ETHUSDTPERP
sym_oi = input.symbol("BINANCE:BTCUSDTPERP", "Open Interest Symbol", group=grp_oi)
len_oi_smooth = input.int(20, "OI Durchschnitt (SMA)", group=grp_oi)
// ══════════════════════════════════════════════════════════════════════════════
// 2. BERECHNUNGEN
// ══════════════════════════════════════════════════════════════════════════════
// EMAs berechnen
ema_fast = ta.ema(close, len_fast)
ema_slow = ta.ema(close, len_slow)
// OI Daten holen (mit Fehlerschutz)
float raw_oi = request.security(sym_oi, timeframe.period, open, ignore_invalid_symbol=true)
// Fallback auf Volumen, falls Symbol falsch ist
float data_src = na(raw_oi) ? volume : raw_oi
// OI Logik: Ist aktuelles OI höher als der Durchschnitt?
oi_ma = ta.sma(data_src, len_oi_smooth)
oi_bullish = data_src > oi_ma
// ══════════════════════════════════════════════════════════════════════════════
// 3. SIGNAL LOGIK
// ══════════════════════════════════════════════════════════════════════════════
// EMA Crossover (Das eigentliche Signal)
cross_up = ta.crossover(ema_fast, ema_slow)
cross_down = ta.crossunder(ema_fast, ema_slow)
// Finale Signale (Nur gültig, wenn OI Filter passt oder deaktiviert ist)
signal_buy = cross_up and (not use_oi or oi_bullish)
signal_sell = cross_down and (not use_oi or oi_bullish)
// ══════════════════════════════════════════════════════════════════════════════
// 4. DARSTELLUNG IM CHART
// ══════════════════════════════════════════════════════════════════════════════
// EMAs zeichnen
p1 = plot(ema_fast, "EMA 9", color=color.yellow, linewidth=2)
p2 = plot(ema_slow, "EMA 15", color=color.blue, linewidth=2)
fill(p1, p2, color = ema_fast > ema_slow ? color.new(color.green, 85) : color.new(color.red, 85))
// KAUF SIGNAL (Grüner Pfeil + Label "BUY")
plotshape(signal_buy, title="Buy Signal", style=shape.labelup, location=location.belowbar, color=color.green, text="BUY", textcolor=color.white, size=size.small)
// VERKAUF SIGNAL (Roter Pfeil + Label "SELL")
plotshape(signal_sell, title="Sell Signal", style=shape.labeldown, location=location.abovebar, color=color.red, text="SELL", textcolor=color.white, size=size.small)
// Hintergrund färben bei Signal für bessere Sichtbarkeit
bgcolor(signal_buy ? color.new(color.green, 80) : na)
bgcolor(signal_sell ? color.new(color.red, 80) : na)
// ══════════════════════════════════════════════════════════════════════════════
// 5. ALARME (FÜR HANDY/APP)
// ══════════════════════════════════════════════════════════════════════════════
alertcondition(signal_buy, title="LONG Signal", message="EMA Cross UP + OI Valid -> BUY")
alertcondition(signal_sell, title="SHORT Signal", message="EMA Cross DOWN + OI Valid -> SELL")
Overview
15m EMA + OI Flip Signals generates BUY signals on the fast EMA crossing above the slow EMA and SELL signals on the opposite crossover. Signals require the open interest filter to be enabled and the current open interest above its 20-period SMA, with fallback to volume if unavailable. The script draws signals directly on the price chart with BUY and SELL labels and highlighted background. Settings include fast and slow EMA lengths, toggle for OI filter, OI symbol selection, and SMA period. Optimized for crypto markets on 15-minute timeframe, it provides entry signals only that traders manage with their own exits.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Fast EMA (Signal)
int
9
len_fast
Slow EMA (Baseline)
int
15
len_slow
Benutze OI Filter?
bool
true
use_oi
Open Interest Symbol
symbol
BINANCE:BTCUSDTPERP
sym_oi
OI Durchschnitt (SMA)
int
20
len_oi_smooth
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 plots a Price Action Channel (PAC) based on high, low, and close moving averages alongside fast, medium, and slow trend EMAs directly on the price chart. It detects regular and Bill Williams fractals to track market structure and identifies pull
This indicator overlays multiple simple moving averages and VWAP directly on the price chart to identify directional pullback and breakout setups. It calculates synthetic Heikin-Ashi values to gauge candle touches across moving averages and requests five-minut
This indicator plots a fast and a slow exponential moving average on the price chart and marks buy and sell signals for Bitcoin scalping. A buy appears when the fast EMA crosses above the slow EMA, RSI is above its buy threshold, the MACD line is above its sig
Sniper Algo is a multi-indicator technical analysis suite that plots directly on the main price chart. It integrates Ichimoku Kinko Hyo components, automated support and resistance zones, dual exponential moving averages, and optional buy and sell signals. Use
The Adaptive Laguerre Filter calculates a smoothed, dynamically adjusted trendline plotted directly on the main price chart. It dynamically adjusts its damping factor (alpha) based on recent price range variations and median percentile calculations over a spec
This indicator scans NSE-listed stocks for momentum signals using Supertrend, multiple EMAs, MACD, and stochastic oscillator. It supports continuous or flip signal modes and displays matching setups in a customizable table at the bottom left of the chart. The