# Directional Matrix

Directional Matrix is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

Directional Matrix grids the direction of four moving averages (SMA, TMA, WMA, and linear regression) across a whole range of lengths, coloring each cell bullish or bearish. The top-left cell tallies the bullish share, and a normalized mode grades how strong each change is. A one-glance trend consensus for any chart.

- Indicator in the LuxAlgo Library, by LuxAlgo, published May 28, 2021.
- Access: free.
- Concepts: [MA Slope Filter](https://www.luxalgo.com/library/concept/ma-slope-filter/) (primary), [MA Ribbon](https://www.luxalgo.com/library/concept/ma-ribbon/)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=cmpwn18nb001nvhsgysfxt3r3
- Page: https://www.luxalgo.com/library/indicator/directional-matrix/

**Directional Matrix** condenses trend into a dashboard: it computes an SMA, TMA, WMA, and linear regression across a whole range of lengths and colors one cell per calculation: bullish when that average is rising, bearish when it is falling. Because the [slope of a moving average](https://www.luxalgo.com/library/concept/ma-slope-filter/) is itself a trend condition, the grid amounts to dozens of trend votes cast at once, with the top-left cell reporting the bullish share.

## How to Trade the Directional Matrix?

- **Grid mostly bullish**: broad agreement across lengths and average types supports a trending long bias; a mostly bearish grid supports the opposite.
- **Top-left percentage**: the proportion of rising cells, a single consensus number to track as conditions shift.
- **Normalized Change Mode**: cells grade change intensity from 0 to 1 on a color gradient, separating decisive moves from drift.

The four columns corroborate each other in useful ways: a rising SMA means price exceeds its level from p bars ago, a rising WMA means price sits above an SMA of period p+1, and a rising REG means a WMA sits above an SMA of the same period. Read together, the matrix behaves like a [moving average ribbon](https://www.luxalgo.com/library/concept/ma-ribbon/) with the geometry stripped out: pure direction, no overlapping lines.

## Directional Matrix Settings

- **Maximum Length**: the top of the period range evaluated for all four indicators.
- **Minimum Length**: where the range starts.
- **Step**: the gap between consecutive periods. Smaller steps add rows and detail, larger steps keep the grid compact.
- **Src**: the data source feeding the calculations.
- **Normalized Change Mode**: replaces direction signs with normalized changes, scaled from 0 (lowest) to 1 (highest) within each column.
- A style block covers dashboard location and size, text/frame color, bullish and bearish cell colors, and cell transparency.

## Frequently Asked Questions

### How is this different from a moving average ribbon?

A ribbon such as the [GMMA MA Ribbon](https://www.luxalgo.com/library/indicator/gmma-ma-ribbon/) draws its averages on the price chart so you read order and compression visually. Directional Matrix removes the lines entirely and reports each average's direction as a cell, which stays legible no matter how many lengths you track.

### What does Normalized Change Mode add?

Instead of a binary rising/falling cell, it shows the normalized first difference of each indicator, scaled 0 to 1 across the selected range. Values near 1 mark the strongest rise in that column and values near 0 the strongest fall (or the weakest rise when every length is rising), so you see how each length's change ranks against the others.

### How can I access the Directional Matrix?

The Directional Matrix is free to use, and Quant, our coding agent, can run it for you straight from its Library page. You can also copy the source code from this page and run it anywhere Pine Script® runs.

## Related indicators

- [MA Sabres](https://www.luxalgo.com/library/indicator/ma-sabres/) (MA Slope Filter): markdown at https://www.luxalgo.com/library/indicator/ma-sabres.md
- [SMA Directional Matrix](https://www.luxalgo.com/library/indicator/sma-directional-matrix/) (MA Slope Filter): markdown at https://www.luxalgo.com/library/indicator/sma-directional-matrix.md
- [Moving Averages Proximity Oscillator](https://www.luxalgo.com/library/indicator/moving-averages-proximity-oscillator/) (MA Ribbon): markdown at https://www.luxalgo.com/library/indicator/moving-averages-proximity-oscillator.md
- [Signal Forge](https://www.luxalgo.com/library/indicator/signal-forge/) (Moving Average Crossovers): markdown at https://www.luxalgo.com/library/indicator/signal-forge.md
- [LuxAlgo - Screener (S&O)](https://www.luxalgo.com/library/indicator/luxalgo-screener-s-o/) (Moving Average Crossovers): markdown at https://www.luxalgo.com/library/indicator/luxalgo-screener-s-o.md
- [Signal Moving Average](https://www.luxalgo.com/library/indicator/signal-moving-average/) (Moving Average Crossovers): markdown at https://www.luxalgo.com/library/indicator/signal-moving-average.md
- [MA of MA](https://www.luxalgo.com/library/indicator/ma-of-ma/) (Trend): markdown at https://www.luxalgo.com/library/indicator/ma-of-ma.md
- [Golden Cross](https://www.luxalgo.com/library/indicator/golden-cross/) (Trend): markdown at https://www.luxalgo.com/library/indicator/golden-cross.md

---

Source: https://www.luxalgo.com/library/indicator/directional-matrix/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
