This indicator transforms the classic components of the Ichimoku Kinko Hyo into a multi-layered momentum oscillator. Rather than reading the components against the price, this tool aggregates the strength of the Tenkan, the Kijun and the Cloud (Kumo) into a single window to identify the strength and quality of a trend.
It is the ideal tool for traders who like Ichimoku but wish to streamline their price chart. It allows you to quickly detect whether a trend is running out of steam or, conversely, whether all the technical indicators point to a major acceleration.
Technical note: The parameters are set by default to optimised cycles (8, 13, 26) with a 13-period lag for increased responsiveness compared to standard settings.
// --- Initialisation des variables (Valeurs par défaut TradingView)
conversionPeriods = 8
basePeriods = 13
laggingSpan2Periods = 26
displacement = 13
useatr = 1 // 1 pour utiliser l'ATR, 0 sinon
atrlen = 9
atrmul = 2.0
emalen = 9
// --- Calculs Ichimoku Standard
HighCL = Highest[conversionPeriods](high)
LowCL = Lowest[conversionPeriods](low)
conversionLine = (HighCL + LowCL) / 2
HighBL = Highest[basePeriods](high)
LowBL = Lowest[basePeriods](low)
baseLine = (HighBL + LowBL) / 2
leadLine1 = (conversionLine + baseLine) / 2
HighLS = Highest[laggingSpan2Periods](high)
LowLS = Lowest[laggingSpan2Periods](low)
leadLine2 = (HighLS + LowLS) / 2
// --- Décalage (Displacement)
CloudMin = min(leadLine1[displacement-1], leadLine2[displacement-1])
CloudMax = max(leadLine1[displacement-1], leadLine2[displacement-1])
// --- Gestion de la tendance (mtrend)
IF close > CloudMax THEN
mtrend = 1
ELSIF close < CloudMin THEN
mtrend = -1
ELSE
mtrend = mtrend[1]
ENDIF
// --- Calcul des 4 couches de l'oscillateur
// Couche 1 : Oscline
IF mtrend = 1 THEN
Oscline = close - CloudMin
ELSE
Oscline = close - CloudMax
ENDIF
// Couche 2 : Lagging
IF mtrend = 1 THEN
Lagging = Oscline + max(close - CloudMax[displacement-1], 0)
ELSE
Lagging = Oscline + min(close - CloudMin[displacement-1], 0)
ENDIF
// Couche 3 : ConvBase
IF mtrend = 1 THEN
ConvBase = Lagging + max(conversionLine - baseLine, 0)
ELSE
ConvBase = Lagging + min(conversionLine - baseLine, 0)
ENDIF
// Couche 4 : Cloud
IF mtrend = 1 THEN
CloudOsc = ConvBase + max(leadLine1 - leadLine2, 0)
ELSE
CloudOsc = ConvBase + min(leadLine1 - leadLine2, 0)
ENDIF
// --- Logique ATR (Whipsaw protection)
myATR = AverageTrueRange[atrlen](close)
tole = 0
IF useatr THEN
tole = myATR * atrmul
ENDIF
// --- Calcul de la force de tendance (trend)
anyRising = (conversionLine > conversionLine[1]) OR (baseLine > baseLine[1])
anyFalling = (conversionLine < conversionLine[1]) OR (baseLine < baseLine[1])
IF mtrend = 1 THEN
IF mtrend[1] = -1 THEN
trend = 0
ENDIF
IF trend < 4 AND close > CloudMax THEN
cond1 = (Lagging > Oscline)
cond2 = (conversionLine >= baseLine AND anyRising)
cond3 = (leadLine1 >= leadLine2)
trend = cond1 + cond2 + cond3 + 1
ELSE
IF conversionLine < (baseLine - tole) THEN
trend = 0
ENDIF
ENDIF
ELSIF mtrend = -1 THEN
IF mtrend[1] = 1 THEN
trend = 0
ENDIF
IF trend > -4 AND close < CloudMin THEN
cond1 = -(Lagging < Oscline)
cond2 = -(conversionLine <= baseLine AND anyFalling)
cond3 = -(leadLine1 <= leadLine2)
trend = cond1 + cond2 + cond3 - 1
ELSE
IF conversionLine > (baseLine + tole) THEN
trend = 0
ENDIF
ENDIF
ENDIF
// --- Moyenne mobile sur l'oscillateur
emaOsc = ExponentialAverage[emalen](CloudOsc)
// --- Coloration du fond (Background)
IF trend >= 1 THEN
BACKGROUNDCOLOR(0, 200, 0, 30) // Vert très clair
ELSIF trend <= -1 THEN
BACKGROUNDCOLOR(0, 0, 200, 30) // Bleu très clair
ENDIF
// --- Affichage des signaux (Flèches sur la ligne 0)
IF trend = 4 AND trend[1] < 4 THEN
DRAWARROWUP(barindex, 0) COLOURED(255,255,255) // Flèche Blanche pour achat
ENDIF
IF trend = -4 AND trend[1] > -4 THEN
DRAWARROWDOWN(barindex, 0) COLOURED(255,255,0) // Flèche Jaune pour vente
ENDIF
RETURN CloudOsc AS "Cloud Layer", ConvBase AS "ConvBase Layer", Lagging AS "Lagging Layer", Oscline AS "Osc Line", emaOsc AS "EMA Cloud", 0 AS "Zero Line"