OPEN-SOURCE SCRIPT
Gaussian Channel System [GCS]

## DESCRIPTION

Gaussian Ribbon Engine (GRE) is a multi-layer trend analysis system built on the Arnaud Legoux Moving Average (ALMA), which applies a Gaussian (bell curve) weighting function to price data instead of the linear or exponential weights used by traditional moving averages.
**Mathematical Foundation**

ALMA uses a Gaussian kernel — the same bell-curve distribution found in statistics and physics — to weight the prices in its lookback window. The Gaussian function is parameterized by two values: offset (which shifts the bell curve left or right, controlling responsiveness vs. smoothness) and sigma (which controls the width of the bell curve, determining how sharply weights decay from the center). The formula applies: w(i) = exp(-((i - offset * (N-1))^2) / (2 * sigma^2 * N^2)), where each price bar receives a weight according to its position on the Gaussian curve. This produces a moving average with mathematically optimal noise filtering properties.
GRE constructs five ALMA layers with increasing periods (default 9, 21, 55, 100, 200), creating a visual ribbon. When all five layers align in order (fastest on top for bullish, fastest on bottom for bearish), the market is in full directional agreement. The spread between the outermost layers, measured as a percentage and compared to its own historical average, identifies squeeze (convergence) and expansion (divergence) conditions.
**9-Point Confluence Scoring**
The scoring matrix evaluates: price vs. Layer 1, Layer 1 vs. 2, Layer 2 vs. 3, Layer 3 vs. 4, Layer 4 vs. 5 alignment, Layer 1 slope direction, Layer 3 slope direction, RSI above/below 50, and DI+/DI- directional movement. Signals fire when the score crosses the configurable threshold with ADX confirmation.
**Features**
- Five-layer ALMA ribbon with Gaussian kernel weighting
- Adjustable offset (0-1) and sigma parameters for fine-tuning the Gaussian bell shape
- Ribbon spread analysis with squeeze and expansion detection
- 9-point confluence scoring with visual dot notation in dashboard
- ATR-based dual take-profit levels (TP1 and TP2)
- Squeeze breakout signals when ribbon compresses then expands
- ADX and volume confirmation filters
- Full color-coded dashboard with regime classification
- Multiple alert conditions

---
Gaussian Ribbon Engine (GRE) is a multi-layer trend analysis system built on the Arnaud Legoux Moving Average (ALMA), which applies a Gaussian (bell curve) weighting function to price data instead of the linear or exponential weights used by traditional moving averages.
**Mathematical Foundation**
ALMA uses a Gaussian kernel — the same bell-curve distribution found in statistics and physics — to weight the prices in its lookback window. The Gaussian function is parameterized by two values: offset (which shifts the bell curve left or right, controlling responsiveness vs. smoothness) and sigma (which controls the width of the bell curve, determining how sharply weights decay from the center). The formula applies: w(i) = exp(-((i - offset * (N-1))^2) / (2 * sigma^2 * N^2)), where each price bar receives a weight according to its position on the Gaussian curve. This produces a moving average with mathematically optimal noise filtering properties.
GRE constructs five ALMA layers with increasing periods (default 9, 21, 55, 100, 200), creating a visual ribbon. When all five layers align in order (fastest on top for bullish, fastest on bottom for bearish), the market is in full directional agreement. The spread between the outermost layers, measured as a percentage and compared to its own historical average, identifies squeeze (convergence) and expansion (divergence) conditions.
**9-Point Confluence Scoring**
The scoring matrix evaluates: price vs. Layer 1, Layer 1 vs. 2, Layer 2 vs. 3, Layer 3 vs. 4, Layer 4 vs. 5 alignment, Layer 1 slope direction, Layer 3 slope direction, RSI above/below 50, and DI+/DI- directional movement. Signals fire when the score crosses the configurable threshold with ADX confirmation.
**Features**
- Five-layer ALMA ribbon with Gaussian kernel weighting
- Adjustable offset (0-1) and sigma parameters for fine-tuning the Gaussian bell shape
- Ribbon spread analysis with squeeze and expansion detection
- 9-point confluence scoring with visual dot notation in dashboard
- ATR-based dual take-profit levels (TP1 and TP2)
- Squeeze breakout signals when ribbon compresses then expands
- ADX and volume confirmation filters
- Full color-coded dashboard with regime classification
- Multiple alert conditions
---
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.