This comprehensive indicator combines trend tracking using moving averages with market structure analysis. It is designed to provide a clear view of price dynamics whilst automatically identifying key pivot points (peaks and troughs).
This tool is particularly effective for scalping and day trading. It allows you to trade only in the direction of the trend (candle colour) whilst waiting for structural breaks (HH/LL) to validate entries.
Technical note: The spacing of the labels (offset) is calculated automatically via the ATR to ensure a clean, non-overlapping display across all assets.
// --- PARAMÈTRES ---
HiLoLen = 10
// --- 1. PAC ---
pacU = ExponentialAverage[HiLoLen](high)
pacL = ExponentialAverage[HiLoLen](low)
pacC = ExponentialAverage[HiLoLen](close)
// --- 2. Ruban ---
e12 = ExponentialAverage[12](close)
e36 = ExponentialAverage[36](close)
// --- 3. EMAs Long Terme (Configuration 1min par défaut) ---
emaF = ExponentialAverage[75](close)
emaM = ExponentialAverage[180](close)
emaS = ExponentialAverage[540](close)
// --- 4. Logique des Fractales et Pivots ---
// On utilise l'ATR pour un espacement automatique propre
offset = AverageTrueRange[14]
// --- FRACTALE HAUTE (Sommets) ---
IF high[2] > high[1] AND high[2] > high[0] AND high[2] > high[3] AND high[2] > high[4] THEN
vTopPrev = vTopCurr
vTopCurr = high[2]
// Affichage du Triangle Rouge
drawtext("▼", barindex[2], high[2] + offset * 0.5) coloured(255,0,0)
// Affichage du texte HH ou LH au-dessus du triangle
IF vTopCurr > vTopPrev THEN
drawtext("HH", barindex[2], high[2] + offset * 1.2) coloured(128,0,0)
ELSE
drawtext("LH", barindex[2], high[2] + offset * 1.2) coloured(128,0,0)
ENDIF
ENDIF
// --- FRACTALE BASSE (Creux) ---
IF low[2] < low[1] AND low[2] < low[0] AND low[2] < low[3] AND low[2] < low[4] THEN
vBotPrev = vBotCurr
vBotCurr = low[2]
// Affichage du Triangle Vert
drawtext("▲", barindex[2], low[2] - offset * 0.5) coloured(0,255,0)
// Affichage du texte HL ou LL au-dessous du triangle
IF vBotCurr > vBotPrev THEN
drawtext("HL", barindex[2], low[2] - offset * 1.2) coloured(0,128,0)
ELSE
drawtext("LL", barindex[2], low[2] - offset * 1.2) coloured(0,128,0)
ENDIF
ENDIF
// --- 5. Coloration Bougies ---
IF close >= pacU THEN
drawcandle(open, high, low, close) coloured(30, 144, 255) // Bleu
ELSIF close <= pacL THEN
drawcandle(open, high, low, close) coloured(178, 34, 34) // Rouge feu
ELSE
drawcandle(open, high, low, close) coloured(128, 128, 128) // Gris
ENDIF
// --- Ligne RETURN ---
RETURN pacU as "PAC High", pacL as "PAC Low", pacC as "PAC Close", e12 as "EMA 12", e36 as "EMA 36", emaF as "EMA Fast", emaM as "EMA Medium", emaS as "EMA Slow"