# SMA Directional Matrix

SMA Directional Matrix compresses an entire stack of simple moving averages into one panel: every period between your chosen Min and Max gets a row showing whether that average is currently rising or falling. Full alignment exposes clean trends, mixed readings expose retracements or ranges. Market posture read in a single glance.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Sep 8, 2020.
- Access: free.
- Concepts: [SMA](https://www.luxalgo.com/library/concept/sma/) (primary), [MA Slope Filter](https://www.luxalgo.com/library/concept/ma-slope-filter/), [MTF Alignment & Confluence Scoring](https://www.luxalgo.com/library/concept/mtf-alignment-and-confluence-scoring/)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=cmpwn5tb70086vhsgqgzmm3mh
- Page: https://www.luxalgo.com/library/indicator/sma-directional-matrix/

The **SMA Directional Matrix** answers a deceptively simple question: across every lookback you care about, which way are the averages pointing? Created in collaboration with alexgrover, it renders a panel listing each [simple moving average](https://www.luxalgo.com/library/concept/sma/) period between a user-defined Min and Max, each beside a symbol for its current direction. One glance replaces plotting dozens of overlapping lines.

## How to Trade the SMA Directional Matrix?

- **All symbols aligned**: mid- and long-period averages agreeing on direction is the signature of a trend running without meaningful retracement.
- **Short periods against long ones**: recent movement fighting the older trend: a retracement in progress, or the first stage of a reversal.
- **A balanced mix**: rising and falling averages in roughly equal number point to a range-bound, undecided market.

Because each row is simply an average's direction, the panel works like a bank of [slope filters](https://www.luxalgo.com/library/concept/ma-slope-filter/) spanning short, mid, and long horizons at once. Watching how quickly the shorter rows flip against the longer ones tells you whether momentum is genuinely turning or merely pausing.

## SMA Directional Matrix Settings

- **Min**: the shortest moving average period included in the panel.
- **Max**: the longest period analyzed.
- **Src**: the source series feeding every average.
- **Number Of Columns**: the panel layout, worth raising when covering a broad period range.

## Frequently Asked Questions

### Why am I seeing a "String is too long" or loop error?

Both stem from an overly wide period range. Narrow the gap between Min and Max and the panel renders normally; for the loop error, resetting the settings and reapplying your configuration usually clears it.

### What does alignment across periods actually tell me?

It measures trend cleanliness. A move that never retraces drags every average up behind it, so the whole panel points one way; retracements show up as mid-term rows breaking ranks. Its close relative, the [Directional Matrix](https://www.luxalgo.com/library/indicator/directional-matrix/), is worth comparing if this style of at-a-glance panel suits your process.

### Is the SMA Directional Matrix free?

Yes. It is available at no cost from its LuxAlgo Library page. You can also spin it up in Quant, our coding agent, right from here and watch the panel react to live data before adding it to your layout. You can also copy the source code from this page and run it anywhere Pine Script® runs.

## Related indicators

- [Donchian MA Bands](https://www.luxalgo.com/library/indicator/donchian-ma-bands/) (SMA): markdown at https://www.luxalgo.com/library/indicator/donchian-ma-bands.md
- [Moving Average](https://www.luxalgo.com/library/indicator/moving-average/) (SMA): markdown at https://www.luxalgo.com/library/indicator/moving-average.md
- [Directional Matrix](https://www.luxalgo.com/library/indicator/directional-matrix/) (MA Slope Filter): markdown at https://www.luxalgo.com/library/indicator/directional-matrix.md
- [MA Sabres](https://www.luxalgo.com/library/indicator/ma-sabres/) (MA Slope Filter): markdown at https://www.luxalgo.com/library/indicator/ma-sabres.md
- [Trend Regularity Adaptive Moving Average](https://www.luxalgo.com/library/indicator/trend-regularity-adaptive-moving-average/) (TRAMA): markdown at https://www.luxalgo.com/library/indicator/trend-regularity-adaptive-moving-average.md
- [Machine Learning Moving Average](https://www.luxalgo.com/library/indicator/machine-learning-moving-average/) (Adaptive-lookback MA): markdown at https://www.luxalgo.com/library/indicator/machine-learning-moving-average.md
- [ZLEMA](https://www.luxalgo.com/library/indicator/zlema/) (Trend): markdown at https://www.luxalgo.com/library/indicator/zlema.md
- [Moving Average Converging](https://www.luxalgo.com/library/indicator/moving-average-converging/) (EMA): markdown at https://www.luxalgo.com/library/indicator/moving-average-converging.md

---

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