Ugo Blanco

Ichimoku Multi-Layer Oscillator

Category: Indicators By: Ugo Blanco Created: May 13, 2026, 6:03 PM
May 13, 2026, 6:03 PM
Indicators
0 Comments
Ichimoku Multi-Layer Oscillator

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.

Key features:

  • The 4-Layer Oscillator: The indicator calculates four superimposed data levels that represent the health of the market:
  1. Oscline: Price position relative to the cloud boundaries.
  2. Lagging: Incorporates the momentum of the Chikou Span (price memory).
  3. ConvBase: Adds the interaction between the Tenkan (Conversion) and the Kijun (Base).
  4. Cloud Layer: The final layer including the thickness and direction of the cloud (Span A/B).
  • Trend Strength Analysis (Trend Score): The indicator does not merely follow the price; it assigns a score of 1 to 4 (positive or negative) based on the convergence of Ichimoku signals.
  • A score of 4 means that all elements (Price, Tenkan/Kijun, Cloud, Lagging) are aligned in an upward trend.
  • A score of -4 indicates a complete bearish alignment.
  • Protection against ‘Whipsaws’ (ATR): The indicator uses the ATR (Average True Range) to create a tolerance zone around the Kijun-sen. This helps to avoid false exit signals during minor market corrections or periods of market noise.
  • Integrated Visual Signals:
  • Background Colouring: The chart turns green or blue depending on whether buying or selling pressure is dominant.
  • Signal Arrows: A white (buy) or yellow (sell) arrow appears on the zero line when the trend score reaches its peak (level 4), signalling a high-probability entry.

Why use it?

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"

Download
Filename: Ichimoku-oscilator.itf
Downloads: 53
Ugo Blanco
Ugo Blanco Junior
This author is like an anonymous function, present but not directly identifiable. More details on this code architect as soon as they exit 'incognito' mode.
Author’s Profile

Comments

ProRealCode ProRealCode
Loading...