OPEN-SOURCE SCRIPT
EMA50 Flux LT (Daily/Weekly)

// 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 LT (Daily/Weekly)", overlay=true)
// === Inputs ===
lenEMA = input.int(50, "Longueur EMA prix")
obvLen = input.int(20, "OBV MA length")
htf = input.timeframe("W", "Timeframe Flux (HTF)") // Par défaut : Weekly
lineWidth = input.int(6, "Épaisseur EMA", minval=1, maxval=12)
// === EMA50 sur la TF active (ex: Daily chart) ===
ema50 = ta.ema(close, lenEMA)
// === Flux HTF (Weekly ou Monthly) ===
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))
// === Signaux binaires ===
obv_signal = obv_htf > obv_ma_htf ? 1 : -1
imb_signal = imb_htf > 0 ? 1 : -1
// === Score total revisité ===
score = obv_signal + imb_signal
flux = score > 0 ? 1 : score < 0 ? -1 : 0
// === Couleurs ===
colFlux = flux > 0 ? color.lime : flux < 0 ? color.red : color.orange
colOutline = color.new(color.white, 70)
// === Tracé double couche ===
plot(ema50, color=colOutline, linewidth=lineWidth + 2, title="Contour EMA")
plot(ema50, color=colFlux, linewidth=lineWidth, title="EMA Flux LT")
// © pizzalolodudu
//version=6
indicator("EMA50 Flux LT (Daily/Weekly)", overlay=true)
// === Inputs ===
lenEMA = input.int(50, "Longueur EMA prix")
obvLen = input.int(20, "OBV MA length")
htf = input.timeframe("W", "Timeframe Flux (HTF)") // Par défaut : Weekly
lineWidth = input.int(6, "Épaisseur EMA", minval=1, maxval=12)
// === EMA50 sur la TF active (ex: Daily chart) ===
ema50 = ta.ema(close, lenEMA)
// === Flux HTF (Weekly ou Monthly) ===
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))
// === Signaux binaires ===
obv_signal = obv_htf > obv_ma_htf ? 1 : -1
imb_signal = imb_htf > 0 ? 1 : -1
// === Score total revisité ===
score = obv_signal + imb_signal
flux = score > 0 ? 1 : score < 0 ? -1 : 0
// === Couleurs ===
colFlux = flux > 0 ? color.lime : flux < 0 ? color.red : color.orange
colOutline = color.new(color.white, 70)
// === Tracé double couche ===
plot(ema50, color=colOutline, linewidth=lineWidth + 2, title="Contour EMA")
plot(ema50, color=colFlux, linewidth=lineWidth, title="EMA Flux LT")
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.