OPEN-SOURCE SCRIPT

ALMA Trend-box

272
This indicator uses the ALMA (Arnaud Legoux Moving Average) – a special type of moving average that provides a smoother and more responsive trend line. Based on the slope (angle) of the ALMA line and the price position relative to it, the indicator:

Colors candles in three different ways (to reflect market structure),

Plots the ALMA line on the chart,

Detects consolidation and highlights it with blue candles, background shading, and horizontal "box" lines.

📘 Candle Colors – How to Interpret Them
Candle Color Meaning Interpretation
🟩 Green Uptrend ALMA is sloping upward and price is above ALMA – look for buying opportunities.
🟥 Red Downtrend ALMA is sloping downward and price is below ALMA – look for selling opportunities.
🔵 Blue Sideways (Consolidation) Weak or neutral trend – market is moving sideways or accumulating.

🔵 What Do Blue Candles and the “Trend-box” Mean?
Blue candles represent consolidation periods, which occur when:

The slope of the ALMA line is less than ±40°, indicating a lack of strong trend,

The price behavior is not consistent with the direction of the slope (e.g., price is below ALMA even though ALMA is pointing upward).

During this time:

Blue candles and a blue background appear to visually highlight the consolidation,

Two dashed horizontal lines (a “box”) are drawn at the high and low of the consolidation range.

📌 The Trend-box helps you visually spot ranging markets, which often precede strong breakouts.

📈 How to Use This Indicator in Practice
Trend Following Strategy:

When candles are green → consider long trades.

When candles are red → consider short trades.

Use additional indicators (like RSI, MACD, or volume) to confirm entries.

Breakout Trading:

When blue candles and the box appear, wait for the price to:

Break above the box → potential long breakout.

Break below the box → potential short breakout.

You can set pending orders (buy stop/sell stop) just outside the box range.

Avoiding Choppy Entries:

Blue candles signal uncertainty – avoid entering impulsively during this time. Wait for trend confirmation.

⚙️ Adjustable Settings
ALMA Length – controls how quickly the moving average reacts.

Slope Threshold – determines the minimum angle required to define a trend.

Candle Colors – fully customizable (green/red/blue by default).

✅ Conclusion
ALMA Trend-box is a powerful visual tool for identifying:

Trending conditions (bullish or bearish),

Sideways markets (consolidation),

Breakout setups with clearly marked zones.

It works well on its own or as part of a larger trading system. Blue candles tell you to be patient, while transitions into green/red candles indicate developing trends.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.