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")
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。