PROTECTED SOURCE SCRIPT
Updated

EMA50 Flux H1

59
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org/MPL/2.0/
// © pizzalolodudu

//version=6
indicator("EMA50 Flux HTF — Version simple (flux direct)", overlay=true)

// === Inputs ===
lenEMA = input.int(50, "Longueur EMA prix")
obvLen = input.int(20, "OBV MA length")
htf = input.timeframe("60", "Timeframe Flux (HTF)")
lineWidth = input.int(6, "Épaisseur EMA", minval=1, maxval=12)

// === EMA50 classique sur la TF active ===
ema50 = ta.ema(close, lenEMA)

// === Flux H1 ===
obv_htf = request.security(syminfo.tickerid, htf, ta.cum(math.sign(ta.change(close)) * volume))
obv_ma_htf = request.security(syminfo.tickerid, htf, ta.sma(ta.cum(math.sign(ta.change(close)) * volume), obvLen))
imb_htf = request.security(syminfo.tickerid, htf, (close > open ? 1 : -1))

// === Volume HTF ===
vol_htf = request.security(syminfo.tickerid, htf, volume)
vol_ma_htf = request.security(syminfo.tickerid, htf, ta.sma(volume, obvLen))

// === Signaux binaires ===
obv_signal = obv_htf > obv_ma_htf ? 1 : -1
imb_signal = imb_htf > 0 ? 1 : -1
vol_signal = vol_htf > vol_ma_htf ? 1 : 0

// === Score total ===
score = obv_signal + imb_signal

// === Flux corrigé ===
flux = score > 0 ? 1 : score < 0 ? -1 : 0

// === Couleurs EMA ===
emaColor = flux > 0 ? color.lime : flux < 0 ? color.red : color.orange

// === Plot EMA50 colorée ===
plot(ema50, title="EMA50 Flux HTF", color=emaColor, linewidth=lineWidth)
Release Notes
//version=6
indicator("EMA50 Flux HTF — Proxy Delta", overlay=true)

// === Inputs ===
lenEMA = input.int(50, "Longueur EMA prix")
obvLen = input.int(20, "OBV MA length")
htf = input.timeframe("60", "Timeframe Flux (HTF)")
lineWidth = input.int(6, "Épaisseur EMA", minval=1, maxval=12)

// === EMA 20 & 100 (repères fixes, sans flux) ===
lenEMA20 = input.int(20, "Longueur EMA20")
lenEMA100 = input.int(100, "Longueur EMA100")

ema20 = ta.ema(close, lenEMA20)
ema100 = ta.ema(close, lenEMA100)
ema50 = ta.ema(close, lenEMA)

plot(ema20, title="EMA20", color=color.new(color.blue, 0), linewidth=1)
plot(ema100, title="EMA100", color=color.new(color.purple, 0), linewidth=1)

// =======================
// --- OBV HTF
// =======================
obv_htf = request.security(syminfo.tickerid, htf, ta.cum(math.sign(ta.change(close)) * volume))
obv_ma_htf = request.security(syminfo.tickerid, htf, ta.sma(ta.cum(math.sign(ta.change(close)) * volume), obvLen))
obv_signal = obv_htf > obv_ma_htf ? 1 : -1

// =======================
// --- Proxy Delta HTF
// =======================
neutralFix = input.float(0.33, "Centre Delta", step=0.01)
smoothLen = input.int(3, "Lissage Delta", minval=1)
ampFactor = input.float(10.0, "Amplification Delta", step=0.5)

f_proxy_delta() =>
body = math.abs(close - open)
barRange = high - low
ratio = barRange > 0 ? body / barRange : 0.0
delta = barRange > 0 ? (close - open) / barRange : 0.0
deltaRaw = (delta + ratio) - neutralFix
deltaSmoothed = ta.ema(deltaRaw, smoothLen)
deltaAmplified = deltaSmoothed * ampFactor
deltaAmplified > 0 ? 1 : -1

delta_signal = request.security(syminfo.tickerid, htf, f_proxy_delta())

// =======================
// --- Score global
// =======================
score = obv_signal + delta_signal
flux = score > 0 ? 1 : score < 0 ? -1 : 0

// === Couleurs EMA ===
emaColor = flux > 0 ? color.lime : flux < 0 ? color.red : color.orange

// === Plot EMA50 colorée ===
plot(ema50, title="EMA50 Flux HTF (Proxy Delta)", color=emaColor, linewidth=lineWidth)
Release Notes
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org/MPL/2.0/
// © PedroDeLaCrypto

//version=6
indicator("EMA50 Flux HTF — Proxy Delta v2", overlay=true)


// === Inputs ===
lenEMA = input.int(50, "Longueur EMA prix")
obvLen = input.int(20, "OBV MA length")
htf = input.timeframe("60", "Timeframe Flux (HTF)")
lineWidth = input.int(6, "Épaisseur EMA", minval=1, maxval=12)

// === EMA 20 & 100 (repères fixes, sans flux) ===
lenEMA20 = input.int(20, "Longueur EMA20")
lenEMA100 = input.int(100, "Longueur EMA100")

ema20 = ta.ema(close, lenEMA20)
ema100 = ta.ema(close, lenEMA100)
ema50 = ta.ema(close, lenEMA)

plot(ema20, title="EMA20", color=color.new(color.blue, 0), linewidth=1)
plot(ema100, title="EMA100", color=color.new(color.purple, 0), linewidth=1)

// =======================
// --- OBV HTF
// =======================
obv_htf = request.security(syminfo.tickerid, htf, ta.cum(math.sign(ta.change(close)) * volume))
obv_ma_htf = request.security(syminfo.tickerid, htf, ta.sma(ta.cum(math.sign(ta.change(close)) * volume), obvLen))
obv_signal = obv_htf > obv_ma_htf ? 1 : -1

// =======================
// --- Proxy Delta HTF
// =======================
neutralFix = input.float(0.33, "Centre Delta", step=0.01)
smoothLen = input.int(3, "Lissage Delta", minval=1)
ampFactor = input.float(10.0, "Amplification Delta", step=0.5)

f_proxy_delta() =>
body = math.abs(close - open)
barRange = high - low
ratio = barRange > 0 ? body / barRange : 0.0
delta = barRange > 0 ? (close - open) / barRange : 0.0
deltaRaw = (delta + ratio) - neutralFix
deltaSmoothed = ta.ema(deltaRaw, smoothLen)
deltaAmplified = deltaSmoothed * ampFactor
deltaAmplified > 0 ? 1 : -1

delta_signal = request.security(syminfo.tickerid, htf, f_proxy_delta())

// =======================
// --- Score global
// =======================
score = obv_signal + delta_signal
flux = score > 0 ? 1 : score < 0 ? -1 : 0

// === Couleurs EMA ===
emaColor = flux > 0 ? color.green : flux < 0 ? color.red : color.orange

// === Plot EMA50 colorée ===
plot(ema50, title="EMA50 Flux HTF (Proxy Delta)", color=emaColor, linewidth=lineWidth)

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.