Indicator · Pine Script v6 · On the chart

15m EMA + OI Flip Signals

by grzresearch

The indicator plots the fast 9 and slow 15 EMA on the price chart and colors the area between them green for bullish trend and red for bearish.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code78
Settings5inputs
LicenceMPL-2.0
Last updateyesterday27 Oct 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 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.

Details

Published by

grzresearch on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Trend, Moving averages, Scalping

Markets

Crypto

Timeframes

M15-H1

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Fast EMA (Signal)int9len_fast
Slow EMA (Baseline)int15len_slow
Benutze OI Filter?booltrueuse_oi
Open Interest SymbolsymbolBINANCE:BTCUSDTPERPsym_oi
OI Durchschnitt (SMA)int20len_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.

Similar Pine Scripts

Scalping PullBack Tool R1.1

by Ahmed-GoCode
5 stars

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

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Scalping PullBack Tool R1.1
3 stars

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

Indicator v5 TrendOscillators & momentum
Updated 1 year ago · MIT GitHub repository of BTC 1–5 min Scalping Signals

Sniper Algo

by TamTH-Dev
2 stars

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

Indicator v5 TrendSupport & resistance
Updated 5 weeks ago · None stated GitHub repository of Sniper Algo
948 stars

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

Indicator v4 TrendMoving averages
Updated 10 days ago · GPL-3.0 GitHub repository of Adaptive Laguerre Filter

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

Indicator v5 Oscillators & momentumMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup: Vijay Thakare Option Buying Scalping Setup Scanner

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers